Execute the job.

@throws \Throwable
346134
public function handle()
    {

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

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

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

        CharacterLocation::firstOrNew([
            'character_id' => $this->getCharacterId(),
        ])->fill([
            'solar_system_id' => $location->solar_system_id,
            'station_id'   => property_exists($location, 'station_id') ?
                $location->station_id : null,
            'structure_id' => property_exists($location, 'structure_id') ?
                $location->structure_id : null,
        ])->save();
    }
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.');
    }
1135475
public function handle()
    {
        $this->splash(sprintf(" Migrating database for '%s'.", $this->argument('dataset')), $this->option('no-splash'));

        $this->runMigration();

        $this->info(' Completed migration.');
        $this->line('');

        $this->line('');
        $this->line(sprintf(" You can now run 'php artisan datasets:sync %s' to populate this database table.", $this->argument('dataset')));
        $this->line('');
    }
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;
            }
        }
    }
568135
public function handle()
    {
        if (! $this->confirmToProceed()) {
            return;
        }

        $this->prepareDatabase();

        // 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->setOutput($this->output)
                ->run($this->getMigrationPaths(), [
                    'pretend' => $this->option('pretend'),
                    'step' => $this->option('step'),
                ]);

        // 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->option('pretend')) {
            $this->call('db:seed', ['--force' => true]);
        }
    }
614672
public function handle()
    {
        // It's possible for the developer to specify the tables to modify in this
        // schema operation. The developer may also specify if this table needs
        // to be freshly created so we can create the appropriate migrations.
        $name = trim($this->input->getArgument('name'));

        $table = $this->input->getOption('table');
        $content = $this->input->getArgument('content');
        $create = $this->input->getOption('create') ?: false;

        // If no table was given as an option but a create option is given then we
        // will use the "create" option as the table name. This allows the devs
        // to pass a table name into this option as a short-cut for creating.
        if (! $table && is_string($create)) {
            $table = $create;

            $create = true;
        }

        // Now we are ready to write the migration out to disk. Once we've written
        // the migration out, we will dump-autoload for the entire framework to
        // make sure that the migrations are registered by the class loaders.
        $this->writeMigration($name, $table, $create,$content);

        $this->composer->dumpAutoloads();
    }
725147
public function handle()
    {
        if ($this->container['queue.failer']->forget($this->argument('id'))) {
            $this->info('Failed job deleted successfully!');
        } else {
            $this->error('No failed job matches the given ID.');
        }
    }
874173
public function handle()
    {
        $models = $this->getUserModels() ;

        foreach ($models as $model) {
            if (!class_exists($model)) {
                $this->error("Class $model does not exist.");
                return;
            }

            if ($this->alreadyUsesLaratrustUserTrait($model)) {
                $this->error("Class $model already uses LaratrustUserTrait.");
                continue;
            }

            Traitor::addTrait($this->targetTrait)->toClass($model);
        }

        $this->info("LaratrustUserTrait added successfully to {$models->implode(', ')}");
    }
796164
public function handle()
    {
    	# Collecting data and initialization
		$alias 		= $this->argument('name');
		$mMode 		= $this->option('m');
		$profileName= $this->option('profile');
		$profile	= ConfigurationManager::Get("profiles.{$profileName}");
		$publisher	= new FilePublisher($profileName, $alias);
		$manipulator= new Manipulator($profileName, $alias);
		# Checking for alias duplicated
		if($mMode == false){
			if(\file_exists(Utility::getAliasPath($alias))){
				switch (ConfigurationManager::Get("profiles.{$profileName}.publishMode")) {
					case 'clean':
						$this->line('Alias directory already exist! Cleaning old directory...');
						Utility::deleteFiles(Utility::getAliasPath($alias));
						break;
					case 'nothing':
						$this->error('Alias directory already exist! publish failed! Please check publishMode configuration for change publish mode.');
						return;
				}
			}	
			# publishing application
			$this->line('Preparing...');
			$publisher->prepare();
			$this->info("copying {$publisher->getFileCount()} files...");
			$progress = $this->output->createProgressBar($publisher->getFileCount());
			$progress->setFormat("%message%<bg=black>(<fg=white>%current%</> OF <fg=yellow>%max%</>)</> <bg=red;fg=white>%percent% %</>");
			$progress->setMessage('Copying Files: ');
			$publisher->startPublish(function() use ($progress){
				$progress->advance();
			},function() use ($progress){
				$progress->finish();
			});
			$this->line('');
			$this->info('done!');
		}
		$this->line('Manipulating codes...');
		$manipulator->startManipulation();
		$this->info('done!');

		$this->line('<bg=white;fg=blue>Your application ready for publish on web server. enjoy it!</>');
    }
439640
public function handle()
    {
        foreach ($this->getModel()->all() as $country) {
            $timezones = DateTimeZone::listIdentifiers(DateTimeZone::PER_COUNTRY, $country->cca2);

            foreach ($timezones as $timezone) {
                $country->timezones()->create([
                    'name'           => $timezone,
                    'offset_gmt'     => $this->offsetGmt($timezone),
                    'offset_hours'   => $this->offsetHours($timezone),
                    'offset_seconds' => $this->offsetSeconds($timezone),
                ]);
            }
        }

        $this->getOutput()->writeln('<info>Seeded:</info> Countries > Timezones');
    }
1029142
public function handle()
    {
        $this->normalizeGeneratorFilter();
        $starterClass = $this->normalizeStarterClass($this->argument('modelStarterClass'));
        $this->isForce = $this->option('force');

        if (!$starterClass) {
            $this->error("Please use scaffold:model Class\To\ModelStarter");
        } elseif (!class_exists($starterClass)) {
            $this->error($starterClass . " doesn't exist");
        } elseif (!$this->isModelStarter($starterClass)) {
            $this->error($starterClass . " is not a ModelStarter");
        } else {
            $this->igniteStarter($starterClass);
        }
    }
228747
public function handle()
    {
        if (!$this->confirmToProceed()) {
            return;
        }

        $this->prepareDatabase();

        // 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->getMigratorNotes() 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]);
        }
    }
927314
public function handle()
    {
        $this->resource = $this->getResourceOnly();
        $this->settings = config('generators.defaults');

        $this->callModel();
        $this->callView();
        $this->callRepository();
        $this->callController();
        $this->callMigration();
        $this->callSeed();
        $this->callMigrate();

        // confirm dump autoload
        if ($this->confirm("Run 'composer dump-autoload'?")) {
            $this->composer->dumpAutoloads();
        }

        $this->info('All Done!');
        $this->info('Remember to add ' . "`Route::resource('" . str_replace('_', '-',
                $this->getCollectionName()) . "', '" . $this->getResourceControllerName() . "');`" . ' in `routes\\web.php`');
    }
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");
    }
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');
    }
595105
public function handle()
    {
        $packageName = $this->argument('name');

        if (!$this->templateStorageEngine->packageExists($packageName)) {
            $this->comment("The package {$packageName} is not currently installed.");

            return;
        }

        $this->line("Removing {$packageName}. Sit back and relax for a minute, this can take a while.");
        $this->templateStorageEngine->removePackage($packageName);
        $this->info("{$packageName} removed.");
    }
213437
public function handle()
    {
        $this->call('key:generate');
        $this->call('storage:link');

        $this->call('vendor:publish', [
            '--provider' => BlogServiceProvider::class
        ]);
        /*$this->call('vendor:publish', [
            '--provider' => PermissionServiceProvider::class,
            '--tag' => 'migrations'
        ]);*/
        $this->call('migrate');

        $this->info('Attempting to set User model as parent to App\User');
        if (file_exists(app_path('User.php'))) {
            $str = file_get_contents(app_path('User.php'));

            if ($str !== false) {
                $str = str_replace('extends Authenticatable', "extends \Tanwencn\Blog\Database\Eloquent\User", $str);

                file_put_contents(app_path('User.php'), $str);
            }
        } else {
            $this->warn('Unable to locate "app/User.php".  Did you move this file?');
            $this->warn('You will need to update this manually.  Change "extends Authenticatable" to "extends \Tanwencn\Blog\Database\Eloquent\User" in your User model');
        }

        $this->call('blog:registerPermissions');
    }