Execute the job.

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

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

        // Get the assets for this character, chunked in a number of blocks
        // that the endpoint will accept.
        CharacterAsset::join('invTypes', 'type_id', '=', 'typeID')
            ->join('invGroups', 'invGroups.groupID', '=', 'invTypes.groupID')
            ->where('character_id', $this->getCharacterId())
            ->where('is_singleton', true)// only singleton items may be named
            // It seems like only items from these categories can be named
            // 2  : Celestial
            // 6  : Ship
            // 22 : Deployable
            // 23 : Starbase
            // 46 : Orbitals
            // 65 : Structure
            ->whereIn('categoryID', [2, 6, 22, 23, 46, 65])
            ->select('item_id')
            ->chunk($this->item_id_limit, function ($item_ids) {

                $this->request_body = $item_ids->pluck('item_id')->all();

                $names = $this->retrieve([
                    'character_id' => $this->getCharacterId(),
                ]);

                collect($names)->each(function ($name) {

                    // "None" seems to indidate that no name is set.
                    if ($name->name === 'None')
                        return;

                    CharacterAsset::where('character_id', $this->getCharacterId())
                        ->where('item_id', $name->item_id)
                        ->update(['name' => $name->name]);
                });
            });
    }
592023
public function handle()
    {
        $this->parseKey();

        $this->files = $this->filesFromKey();

        try {
            $this->languages = $this->getLanguages();
        } catch (InvalidArgumentException $e) {
            $this->error($e->getMessage());

            return;
        }

        $this->table(
            array_merge(['key'], $this->languages),
            $this->tableRows()
        );
    }
487615
public function handle()
    {
        if (count($jobs = $this->getFailedJobs()) === 0) {
            return $this->info('No failed jobs!');
        }

        $this->displayFailedJobs($jobs);
    }
831445
public function execute()
    {
        // sort jobs by priority
        $jobs = [];
        ksort($this->jobs);
        foreach ($this->jobs as $priority_jobs) {
            $jobs = array_merge($jobs, $priority_jobs);
        }

        /* @var $job Job */
        foreach ($jobs as $job) {
            $job->execute();
        }
    }
275098
public function handle()
    {
        $clear = $this->clearTransients();
        if($clear !== 0) {
            $this->error(Helpers::getLang(get_class($this), 'error', ['count' => $clear]));
            return;
        }
        $this->info(Helpers::getLang(get_class($this), 'success', []));
        return;
    }
739907
public function handle()
    {
        $this->profile = $this->argument('profile');

        // check valid profile
        if (!Config::get('ntrust.profiles.' . $this->profile))
        {
            $this->error('Invalid profile. Please check profiles in config/ntrust.php');
            return;
        }

        $this->line(substr(__DIR__, 0, -8).'views');

        $this->laravel->view->addNamespace('ntrust', substr(__DIR__, 0, -15).'views');

        $rolesTable          = Config::get('ntrust.profiles.'. $this->profile .'.roles_table');
        $roleUserTable       = Config::get('ntrust.profiles.'. $this->profile .'.role_user_table');
        $permissionsTable    = Config::get('ntrust.profiles.'. $this->profile .'.permissions_table');
        $permissionRoleTable = Config::get('ntrust.profiles.'. $this->profile .'.permission_role_table');

        $this->line('');
        $this->info( "Tables: $rolesTable, $roleUserTable, $permissionsTable, $permissionRoleTable" );

        $message = "A migration that creates '$rolesTable', '$roleUserTable', '$permissionsTable', '$permissionRoleTable'".
            " tables will be created in database/migrations directory";

        $this->comment($message);
        $this->line('');

        if ($this->confirm("Proceed with the migration creation? [Yes|no]", "Yes")) {

            $this->line('');

            $this->info("Creating migration...");
            if ($this->createMigration($rolesTable, $roleUserTable, $permissionsTable, $permissionRoleTable)) {

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

            $this->line('');

        }
    }
1045253
public function handle()
    {

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

        while (true) {

            $bookmarks = $this->retrieve([
                'character_id' => $this->getCharacterId(),
            ]);

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

            collect($bookmarks)->chunk(1000)->each(function ($chunk) {

                $records = $chunk->map(function ($bookmark, $key) {

                    $normalized_location = $this->find_nearest_celestial(
                        $bookmark->location_id,
                        $bookmark->position->x ?? 0.0,
                        $bookmark->position->y ?? 0.0,
                        $bookmark->position->z ?? 0.0);

                    return [
                        'character_id' => $this->getCharacterId(),
                        'bookmark_id'  => $bookmark->bookmark_id,
                        'creator_id'   => $bookmark->creator_id,
                        'folder_id'    => $bookmark->folder_id ?? null,
                        'created'      => carbon($bookmark->created),
                        'label'        => $bookmark->label,
                        'notes'        => $bookmark->notes,
                        'location_id'  => $bookmark->location_id,
                        'item_id'      => $bookmark->item->item_id ?? null,
                        'type_id'      => $bookmark->item->type_id ?? null,
                        'x'            => $bookmark->coordinates->x ?? null,
                        'y'            => $bookmark->coordinates->y ?? null,
                        'z'            => $bookmark->coordinates->z ?? null,
                        'map_id'       => $normalized_location['map_id'],
                        'map_name'     => $normalized_location['map_name'],
                        'created_at'   => carbon(),
                        'updated_at'   => carbon(),
                    ];
                });

                CharacterBookmark::upsert($records->toArray(), [
                    'character_id',
                    'bookmark_id',
                    'creator_id',
                    'folder_id',
                    'created',
                    'label',
                    'notes',
                    'location_id',
                    'item_id',
                    'type_id',
                    'x',
                    'y',
                    'z',
                    'map_id',
                    'map_name',
                    'updated_at',
                ]);
            });

            $this->known_bookmarks->push(collect($bookmarks)
                ->pluck('bookmark_id')->flatten()->all());

            if (! $this->nextPage($bookmarks->pages))
                break;
        }

        CharacterBookmark::where('character_id', $this->getCharacterId())
            ->whereNotIn('bookmark_id', $this->known_bookmarks->flatten()->all())
            ->delete();
    }
680063
public function handle()
    {
        $role = $this->argument('name');

        try {
            factory(Role::class)->create(['name' => $role]);
        } catch (QueryException $e) {
            $this->error("Role name '{$role}' is already exist, choose another name");
        }
    }
1074849
public function run() : void
    {
        $request = Request::getCurrent();
        $response = $this->handle($request);
        $response->send();
    }
27410
public function execute()
    {
        $this->boot();

        $this->registerRootCommand();

        $this->registerCommands();

        $this->prepareExecute();

        $this->triggerEvent('onBeforeExecute', ['app' => $this]);

        // Perform application routines.
        $exitCode = $this->doExecute();

        $this->triggerEvent('onAfterExecute', ['app' => $this]);

        exit($this->postExecute($exitCode));
    }
1188790
public function handle()
    {
        if (ServiceProvider::ideHelperIsInstalled() && ServiceProvider::ideHelperIsAvailable()) {
            try {
                $this->call('ide-helper:generate', []);
            } catch (Exception $e) {
                $this->error($e->getMessage());
            }

            try {
                $this->call('ide-helper:meta', [
                    '--filename' => sprintf(
                        '%s.%s',
                        config('ide-helper.meta_filename', ServiceProvider::META_FILENAME),
                        config('ide-helper.format', ServiceProvider::FILES_FORMAT)
                    ),
                ]);
            } catch (Exception $e) {
                $this->error($e->getMessage());
            }

            try {
                $this->call('ide-helper:models', [
                    '--nowrite'  => true,
                    '--reset'    => true,
                    '--filename' => sprintf(
                        '%s.%s',
                        config('ide-helper.models_filename', ServiceProvider::MODELS_FILENAME),
                        config('ide-helper.format', ServiceProvider::FILES_FORMAT)
                    ),
                ]);
            } catch (Exception $e) {
                $this->error($e->getMessage());
            }
        } else {
            $this->warn('IDE Helper is not ready for running. Skip.');
        }
    }
753555
public function handle()
    {
        $this->getApplication()->setCatchExceptions(false);

        $shell = new Shell($this->getConfig());
        $shell->addCommands($this->getCommands());
        $shell->setIncludes($this->argument('include'));

        $loader = ClassAliasAutoloader::register($shell, $this->autoLoadClassMap());

        try {
            $shell->run();
        } finally {
            $loader->unregister();
        }
    }
176078
public function handle()
    {
        $this->createEnv();

        $this->getDatabaseInformation();
        /**
         * Migrate tables
         */
        $this->line('Migrate database...');
        $this->app->register(InstallModuleServiceProvider::class);

        $this->line('Create super admin role...');
        $this->createSuperAdminRole();
        $this->line('Create admin user...');
        $this->createAdminUser();
        $this->line('Install module dependencies...');
        $this->registerInstallModuleService();

        session()->flush();
        session()->regenerate();
        \Artisan::call('cache:clear');
        \Artisan::call('view:clear');

        $this->info("\nWebEd installed. Current version is " . get_cms_version());
    }
256566
public function handle()
    {
        $package = $this->argument('package');
        $command = $this->argument('commandname');
        if (Package::where('name', $package)->count() > 0) {
            throw new Exception("Package with name ($package) already exist");
        }
        if (Package::where('command', $command)->count() > 0) {
            throw new Exception("Package with command ($command) already exist");
        }
        Package::create([
            'name' => $package,
            'namespace' => $this->argument('namespace'),
            'command' => $command,
        ]);
    }
1103738
public function handle()
    {
        $this->abortCommandExecution();
        if (! $this->argument('action') || $this->argument('action') == 'list') {
            $this->listEnvVariables();
            return;
        }

        if ($this->argument('action') == 'edit') {
            $this->editEnvVariables();
            return;
        }

        if ($this->argument('action') == 'check') {
            $this->checkEnvVariable();
            return;
        }
    }
51455
public function execute()
    {
        $this->triggerBeforeCreationEvent();
        $operation = $this->getAddOperation()->setServer($this->server);
        $this->connection->execute($operation);
        $this->triggerAfterCreationEvent($operation);
    }
315700
public function run()
    {
        try {
            $this->loop->run();
        } catch (WorkerException $e) {
            $this->logger->error('Worker Error: ' . $e->getMessage());
        }
    }