Execute the job.

@return void
@throws \Exception
184603
public function handle()
    {

        if (! $this->preflighted()) return;

        $event_ids = CharacterCalendarEvent::where('character_id', $this->getCharacterId())
            ->whereNotIn('event_id', function ($query) {

                $query->select('event_id')
                    ->from('character_calendar_event_details');

            })->pluck('event_id');

        $event_ids->each(function ($event_id) {

            try {
                $detail = $this->retrieve([
                    'character_id' => $this->getCharacterId(),
                    'event_id' => $event_id,
                ]);

                if ($detail->isCachedLoad()) return;

                CharacterCalendarEventDetail::firstOrCreate([
                    'event_id' => $event_id,
                ], [
                    'owner_id' => $detail->owner_id,
                    'owner_name' => $detail->owner_name,
                    'duration' => $detail->duration,
                    'text' => $detail->text,
                    'owner_type' => $detail->owner_type,
                ]);
            } catch (RequestFailedException $e) {
                if (strtolower($e->getError()) == 'event not found!') {
                    CharacterCalendarEvent::where('character_id', $this->getCharacterId())
                                          ->where('event_id', $event_id)
                                          ->delete();

                    return;
                }

                throw $e;
            }
        });
    }
100345
public function handle()
    {
        $this->currentRoot = trim($this->laravel->getNamespace(), '\\');

        $this->setAppDirectoryNamespace();
        $this->setBootstrapNamespaces();
        $this->setConfigNamespaces();
        $this->setComposerNamespace();
        $this->setDatabaseFactoryNamespaces();

        $this->info('Application namespace set!');

        $this->composer->dumpAutoloads();

        $this->call('optimize:clear');
    }
1318798
public function handle()
    {
        $this->laravel->view->addNamespace('settings', __DIR__ . '/../views');

        $this->line('');

        $this->info("Creating migration...");
        if ($this->createMigration()) {
            $this->info("Migration successfully created!");
        } else {
            $this->error(
                "Couldn't create migration.\n Check the write permissions" .
                " within the database/migrations directory."
            );
        }

        $this->line('');
    }
1244023
public function handle()
    {

        if (! $this->preflighted()) return;

        $this->entity_ids = collect();

        $this->entity_ids->push(CharacterWalletJournal::select('first_party_id')
            ->whereNotIn('first_party_id', UniverseName::select('entity_id')->distinct()->get())
            ->whereNotNull('first_party_id')
            ->distinct()
            ->get()
            ->pluck('first_party_id')
            ->toArray());

        $this->entity_ids->push(CharacterWalletJournal::select('second_party_id')
            ->whereNotIn('second_party_id', UniverseName::select('entity_id')->distinct()->get())
            ->whereNotNull('second_party_id')
            ->distinct()
            ->get()
            ->pluck('second_party_id')
            ->toArray());

        $this->entity_ids->flatten()->chunk($this->items_id_limit)->each(function ($chunk) {

            $this->request_body = collect($chunk->values()->all())->unique()->values()->all();

            $resolutions = $this->retrieve();

            collect($resolutions)->each(function ($resolution) {

                UniverseName::firstOrNew([
                    'entity_id' => $resolution->id,
                ])->fill([
                    'name'     => $resolution->name,
                    'category' => $resolution->category,
                ])->save();

            });

        });
    }
951953
public function handle()
    {
        $exception = $this->getException();

        Log::logger('ErrorHandler')->error($exception->getMessage(), [
            'exception' => get_class($exception),
            'file' => sprintf(
                "%s on line %d",
                $exception->getFile(),
                $exception->getLine()
            )
        ]);

        $template = new Template();

        $template = $template->initialize();
        $view = 'errors/500.html.twig';
        $code = 500;
        if (
            ($exception instanceof ControllerNotFoundException) ||
            ($exception instanceof ActionNotFoundException)
        ) {
            $view = 'errors/404.html.twig';
            $code = 404;
        }

        $data = ['exception' => $exception];
        $html = $template->parse($view)
            ->process($data);

        $this->app->response->setStatusCode($code)
            ->setContent($html);

        $this->app->response->send();
    }
599405
public function handle()
    {
        try
        {
            // Get the compiled files
            $compiledFiles = File::glob(base_path('scaffolder-config/cache/*.scf'));

            // Start progress bar
            $this->output->progressStart(count($compiledFiles));

            foreach ($compiledFiles as $compiledFile)
            {
                File::delete($compiledFile);

                // Advance progress
                $this->output->progressAdvance();
            }

            // Finish progress
            $this->output->progressFinish();

            $this->info('Cache cleared');
        }
        catch (\Exception $exception)
        {
            Log::error($exception->getMessage());
        }
    }
1178062
public function execute()
	{
		$query  = $this->factory->builder($this->update)->process();
		$result = $this->pdo->query($query);
		if(!$result)
		{
			throw new \Exception('An error while updating is occurred');
		}
	}
922510
public function run() {
        try {
            $this->command->execute($this->console, $this->parser->getArguments());
        } catch (\Exception $e) {
            $this->writeException($e);
            if ($this->exitOnException) {
                exit($e->getCode() ? : 1);
            }
            throw $e;
        }
    }
218521
public function handle()
    {

        $connectionName = ! empty($this->argument('connection')) && $this->argument('connection') != 'null'
            ? $this->argument('connection') : config('database.default');
        $connection = config('database.connections.' . $connectionName);

        if (empty($connection)) {
            $this->info('No connection details');
            return false;
        }

        if ($connection['driver'] != 'mysql') {
            return $this->notMysql();
        }

        $cmd = $this->makeCommand($connection, $connectionName);

        try {
            exec($cmd);
        } catch (\Exception $e) {
            $this->info('There was an error');
            $this->info('Message: ' . $e->getMessage());
            $this->info('Trace: ' . $e->getTraceAsString());
            return false;
        }

    }
381765
public function handle()
    {
        $index = $this->index();

        // Checks if the target index exists
        if (!$this->existsStatement($index)) {
            $this->error('Index « '.$index.' » does not exists.');

            return;
        }

        // Runs the mappings
        if ($this->option('mappings')) {
            $this->call('mapping:rerun', [
                '--index'    => $index,
                '--database' => $this->option('database'),
                '--force'    => true,
            ]);
        }

        // Populates the index
        try {
            $this->populateIndex($index);
        } catch (\Exception $e) {
            $this->warn('An error occured while populating the new index !');

            throw $e;
        }
    }
737945
public function handle()
    {

        // Ask what command
        $command = $this->choice('What command are you running?', $this->availableCommands->toArray());

        if (!$this->availableCommands->has($command)) {
            $this->info('The specified command does not exist.');
            return;
        }

        $method = 'make' . ucfirst($command);
        call_user_func([$this, $method]);

        $this->call('make:'. $command, $this->options);
    }
838478
public function handle()
    {

        // $this->info($this->option('language'));

        $locales = Config::get('app.locales');

        if($this->option('file') != null)
        {
            $file = base_path('resources/lang/en/'.$this->option('file'));

            foreach ($locales as $localeKey => $value) 
            {
                if($localeKey != 'en')
                {
                   $this->translate($localeKey,$file);
                }
            }   
        }
        else
        {
            $files = File::allFiles(base_path('resources/lang/en'));
            foreach ($files as $file)
            {   
                if($this->option('language') != null)
                {
                    $this->translate($this->option('language'),$file);
                }
                else
                {
                    foreach ($locales as $localeKey => $value) 
                    {
                        if($localeKey != 'en')
                        {
                           $this->translate($localeKey,$file);
                        }
                    
                    }    
                }
            }
        }
        
    }
1248483
public function handle(): void
    {
        $start = $this->argument('start');
        $end = $this->argument('end');
        $disk = $this->argument('disk');

        $resources = $this->resourceService->getRepository()->makeQuery()
            ->select('id', 'path', 'mime_type')
            ->setEagerLoads([])
            ->skip($start)
            ->take($end)
            ->get();

        foreach ($resources as $resource) {
            $this->resourceService->createPreviewThumb(
                $resource->id,
                $resource->path,
                $resource->mime_type,
                $disk,
                [],
                true
            );
        }
    }
966864
public function handle()
    {
        $target = $this->argument('target');
        $options = [
            'compress' => $this->option('compress'),
            'json' => $this->option('json'),
            'no-lib' => $this->option('no-lib'),
            'source' => $this->option('source'),
        ];

        if ($this->generator->generate($target, $options)) {
            $this->info("Created: {$target}");

            return;
        }

        $this->error("Could not create: {$target}");
    }
755843
public function handle(): void
    {
        $this->dbMigrate();
        $this->populateReactionTypes();
        $this->populateReacters();
        $this->populateReactants();
        $this->populateReactions();
        $this->dbCleanup();
        $this->filesystemCleanup();
    }
828856
public function handle(): void
    {
        $this->translations = Translation::all();
        $this->translation_groups = TranslationGroup::all();
	    
        $this->getAllLanguagesFromTable();
        $this->generateLanguageFolders();
        $this->generateGroupFiles();
        $this->generateFileContentArray();
        $this->distributeArrayToFiles();
    }
224900
public function handle()
    {
        $requestLogger = app(ResponseLogger::class);
        $requestLogger->log($this->request, $this->response);
    }