Execute the job.

@throws \Throwable
177515
public function handle()
    {

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

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

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

        collect($killmails)->each(function ($killmail) {

            CharacterKillmail::firstOrCreate([
                'character_id'  => $this->getCharacterId(),
                'killmail_id'   => $killmail->killmail_id,
            ], [
                'killmail_hash' => $killmail->killmail_hash,
            ]);
        });
    }
1086794
public function handle()
    {

        // setup for crud

        $this->modelName = $this->formatModel($this->argument('ModelName'));

        $this->slug = $this->argument('Slug');



        $this->setCrudTokens();


        $this->setFilePaths();



        // setup for views

        $this->setConfigFromInputs();


        // runs all commands

        if  ($this->makeCrudFiles() &&
             $this->makeViewDirectory()->makeViewFiles($this->templateType)){

            $this->sendSuccessMessage();

            return;

        }


        $this->error('Oops, something went wrong!');


    }
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);
    }
363120
public function handle()
    {
        $prefix = $this->option('prefixVersionWith');
        $suffix = $this->option('suffixVersionWith');

        $currentVersion = $this->updater->source()->getVersionInstalled($prefix, $suffix);
        $isAvail = $this->updater->source()->isNewVersionAvailable($currentVersion);

        if ($isAvail) {
            $newVersion = $this->updater->source()->getVersionAvailable();
            $this->info('A new version ['.$newVersion.'] is available.');
        } else {
            $this->comment('There\'s no new version available.');
        }
    }
69053
public function handle(): void
    {
        $name = $this->getNameInput();

        $path = app_path($name);

        // First we will check to see if the class already exists. If it does, we don't want
        // to create the class and overwrite the user's code. So, we will bail out so the
        // code is untouched. Otherwise, we will continue generating this class' files.
        if ($this->files->exists($path)) {
            $this->error($this->type.' already exists!');

            return;
        }

        // Next, we will generate the path to the location where this class' file should get
        // written. Then, we will build the class and make the proper replacements on the
        // stub files so that it gets the correctly formatted namespace and class name.
        $stubs = __DIR__.'/../../../resources/stubs/module';
        $this->processStubs($stubs, $path);
        $this->generateSamples();

        $this->info($this->type.' created successfully.');
    }
1180179
public function handle()
    {
        $repository = modules($this->option('location') ?? config('modules.default_location'));

        $slug = $this->argument('slug');

        if ($slug) {
            if (! $repository->exists($slug)) {
                return $this->error('Module does not exist.');
            }

            if ($repository->isEnabled($slug)) {
                $this->seed($slug, $repository);
            }
            elseif ($this->option('force')) {
                $this->seed($slug, $repository);
            }

            return;
        }
        else {
            if ($this->option('force')) {
                $modules = $repository->all();
            }
            else {
                $modules = $repository->enabled();
            }

            foreach ($modules as $module) {
                $this->seed($module['slug'], $repository);
            }
        }
    }
1368446
public function handle()
    {
        $input = $this->getCommandInput();

        if ($this->isRouteNameExists($this->getDotNotationName($this->getModelName($input->modelName), $input->prefix, 'index'))) {
            $this->warn("The routes already registered!");
            return;
        }

        $routesFile = $this->getRoutesFileName();

        if (!$this->isFileExists($routesFile)) {
            throw new Exception("The routes file does not exists. The expected location was " . $routesFile);
        }

        $stub = $this->getStubContent('routes');

        $controllnerName = $this->getControllerName($input->controllerName, $input->controllerDirectory);

        $this->replaceModelName($stub, $input->modelName)
            ->replaceControllerName($stub, $controllnerName)
            ->replaceRouteNames($stub, $this->getModelName($input->modelName), $input->prefix)
            ->processRoutesGroup($stub, $input->prefix, $input->controllerDirectory)
            ->appendToRoutesFile($stub, $routesFile)
            ->info('The routes were added successfully.');
    }
343392
public function handle()
    {

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

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

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

        collect($implants)->each(function ($implant) {

            CharacterImplant::firstOrCreate([
                'character_id' => $this->getCharacterId(),
                'type_id'      => $implant,
            ]);
        });

        CharacterImplant::where('character_id', $this->getCharacterId())
            ->whereNotIn('type_id', collect($implants)->flatten()->all())
            ->delete();
    }
364221
public function handle(): void
    {
        collect(Artisan::all())->filter(function ($command) {
            return mb_strpos($command->getName(), 'cortex:rollback:') !== false;
        })->partition(function ($command) {
            return in_array($command->getName(), ['cortex:rollback:foundation', 'cortex:rollback:auth']);
        })->flatten()->each->run(new ArrayInput(['--force' => $this->option('force')]), $this->output);
    }
808956
public function handle()
    {
        $seed = new DatabaseSeeder();
        $seed->run();

        $this->line("Seeding: RoleTableSeeder");
        //$this->line("Seeding: UserTableSeeder");
        $this->line("Seeding: BannerTableSeeder");
        $this->line("Seeding: PageTableSeeder");
        $this->line("Seeding: NavigationAdminTableSeeder");
        $this->info("Database seeding completed successfully.");

        //$this->line("User Credentials");
        //$this->info("Email: admin@laravel.local");
        //$this->info("Password: admin");
    }
1143248
public function handle()
    {
        $name = $this->argument('name');

        //
        // Model - Controller - (Policy)
        //

        $this->call('make:model', ['name' => $name]);

        $this->call('make:controller', ['name' => $name.'Controller', '--model' => $name]);

        // Conditionally create policy
        if ($this->anticipate('Would you like to create a policy for this resource?', ['yes', 'no']) == 'yes') {
            $this->call('make:policy', ['name' => $name.'Policy', '-m' => $name]);
        }

        //
        // Migration - (Seed)
        //

        $migrationName = 'create_' . str_plural(snake_case($name)) . '_table';
        $this->call('make:migration', ['name' => $migrationName]);

        // Conditionally create seeder
        if ($this->anticipate('Would you like to create a Seeder for this resource?', ['yes', 'no']) == 'yes') {
            $this->call('make:seeder', ['name' => str_plural($name) . 'Seeder']);
        }

        // @todo: Add seeder class to DatabaseSeeder.php
    }
128262
public function handle()
    {
        $path = $this->cd_connector->ls("/", false, "branch")['data'];
        foreach ($path as $p){
            if($p['type']=='folder'){
                $this->info($p['value']);
            }else{
                $this->line($p['value']);
            }
        }
    }
89367
public function handle()
    {
        // Set up the keys
        $this->setupKeys();

        // Check that the keys hve been set up
        if (empty($this->old_keys) || count($this->old_keys) == 0) {
            $this->comment('Please over-ride this class with old_keys set correctly');
            exit(1);
        }

        if (empty($this->new_key)) {
            $this->comment('Please over-ride this class with old_keys set correctly');
            exit(1);
        }

        if (empty($this->tables) || count($this->tables) == 0) {
            $this->comment('Please over-ride this class with tables set correctly');
            exit(1);
        }

        // Make some encrypter objects
        $cipher        = Config::get('app.cipher');
        $baseEncrypter = new Encrypter($this->new_key, $cipher);
        $oldEncrypter  = [];
        foreach ($this->old_keys as $key => $value) {
            $oldEncrypter[$key] = new Encrypter($value, $cipher);
        }

        foreach ($this->tables as $table_name) {
            $this->comment("Fetching data from $table_name");

            // Get count of records
            $count = DB::table($table_name)
                ->count();

            // Create a progress bar
            $bar = $this->output->createProgressBar($count);

            $count = number_format($count, 0, '.', ',');
            $this->comment('Found ' . $count . ' records in DB. Checking encryption keys.');

            // Get a table object
            $table_data = DB::table($table_name);

            // Cycle through the table data 1000 records at a time
            $chunk = 1000;
            $table_data->chunk($chunk, function ($data) use ($bar, $chunk, $baseEncrypter, $oldEncrypter, $table_name) {
                foreach ($data as $datum) {
                    $datum_array = get_object_vars($datum);

                    // Check every column of the table for an encrypted value.  If the value is
                    // encrypted then try to decrypt it with the base encrypter.
                    $adjust = [];
                    foreach ($datum_array as $key => $value) {
                        if (! $this->isEncrypted($value)) {
                            continue;
                        }

                        try {
                            $test = $this->decryptedAttribute($value, $baseEncrypter);
                            continue;
                        } catch (\Exception $e) {

                            // If the base encrypter fails then try to decrypt it with each
                            // other encrypter until one works or they all fail.

                            $new_value = '';
                            foreach ($oldEncrypter as $cipher) {
                                try {
                                    $test = $this->decryptedAttribute($value, $cipher);

                                    // If that did not throw an exception then we have a match
                                    // between the old encrypter and the encrypted value, so
                                    // adjust the new value.
                                    $new_value = $this->encryptedAttribute($test, $baseEncrypter);
                                    continue;
                                } catch (\Exception $e) {
                                    // Do nothing, keep trying.
                                }
                            }

                            // If we got a match then we will have something in $new_value
                            if (empty($new_value)) {
                                Log::error(__CLASS__ . ':' . __TRAIT__ . ':' . __FILE__ . ':' . __LINE__ . ':' . __FUNCTION__ . ':' .
                                    "Unable to find an encryption key to match for ${table_name}.${key} ID " . $datum->id
                                );
                                continue;
                            }

                            // We got a match
                            $adjust[$key] = $new_value;
                        }
                    }

                    // Now if we have anything in $adjust we can write that back to the database
                    if (count($adjust) == 0) {
                        continue;
                    }

                    DB::table($table_name)
                        ->where('id', '=', $datum->id)
                        ->update($adjust);
                }

                // Advance the stick along one.
                $bar->advance($chunk);
            });

            // After each table, finish the progress bar.
            $bar->finish();
            $this->comment('');
        }

        $this->comment('All tables complete');
    }
1288968
public function handle(): void
    {
        $this->initCommands();

        foreach ($this->calls as $info) {
            if (! isset($info['command'])) {
                continue;
            }

            $params = (isset($info['params'])) ? $info['params'] : [];

            $this->line(PHP_EOL.$info['description']);

            switch ($info['type']) {
                case 'artisan':
                    $this->call($info['command'], $params);
                    break;
                case 'cli':
                    $process = new Process($info['command']);
                    $process->run();
                    break;
            }
        }
    }
583075
public function handle()
    {
        $model = trim($this->argument('model'));

        $this->writeMapping($model);

        $this->composer->dumpAutoloads();
    }
236539
public function handle()
    {
        if (! $this->confirmToProceed()) {
            return;
        }

        $this->migrator->setConnection($this->option('database'));

        // Next, we will check to see if a path option has been defined. If it has
        // we will use the path relative to the root of this installation folder
        // so that migrations may be run for any path within the applications.
        $this->migrator->run($this->getMigrationPaths(), [
            'pretend' => $this->option('pretend'),
            'step' => $this->option('step'),
        ]);
        // Once the migrator has run we will grab the note output and send it out to
        // the console screen, since the migrator itself functions without having
        // any instances of the OutputInterface contract passed into the class.
        foreach ($this->migrator->getNotes() as $note) {
            $this->output->writeln($note);
        }
        // Finally, if the "seed" option has been given, we will re-run the database
        // seed task to re-populate the database, which is convenient when adding
        // a migration and a seed at the same time, as it is only this command.
        if ($this->option('seed')) {
            $this->call('db:seed', ['--force' => true]);
        }
    }
967136
public function handle()
    {
        if (! $this->confirmToProceed()) {
            return;
        }

        $slug = $this->argument('slug');

        if (! $this->packages->exists($slug)) {
            return $this->error('Package does not exist.');
        }

        $this->call('package:migrate:reset', array(
            'slug'       => $slug,
            '--database' => $this->option('database'),
            '--force'    => $this->option('force'),
            '--pretend'  => $this->option('pretend'),
        ));

        $this->call('package:migrate', array(
            'slug'       => $slug,
            '--database' => $this->option('database'),
        ));

        if ($this->needsSeeding()) {
            $this->runSeeder($slug, $this->option('database'));
        }

        $this->info('Package has been refreshed.');
    }