Execute the console command.

@param  \Laravel\Horizon\SupervisorFactory  $factory
@return int
9277
public function handle(SupervisorFactory $factory)
    {
        $supervisor = $factory->make(
            $this->supervisorOptions()
        );

        try {
            $supervisor->ensureNoDuplicateSupervisors();
        } catch (Exception $e) {
            $this->error('A supervisor with this name is already running.');

            return 13;
        }

        $this->start($supervisor);
    }
1227956
public function handle()
    {
        $this->abortCommandExecution();
        $http_method = 'post';
        $action = 'Enabling';
        $actionp = 'Enabled';
        if ($this->option('disable')) {
            $action = 'Disabling';
            $http_method = 'delete';
            $actionp = 'Disabled';
        }

        $this->info("$action autodeploy on Laravel Forge Site...");

        $uri = str_replace('{forgeserver}', $this->server, config('forge-publish.post_auto_deploy_uri'));
        $uri = str_replace('{forgesite}', $this->site, $uri);
        $url = config('forge-publish.url') . $uri;

        $this->http->$http_method($url,
            [
                'headers' => [
                    'X-Requested-With' => 'XMLHttpRequest',
                    'Authorization' => 'Bearer ' . fp_env('ACACHA_FORGE_ACCESS_TOKEN')
                ]
            ]
        );

        $this->info("Autodeploy on Laravel Forge Site $actionp!");
    }
413986
public function fire()
    {
        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->container['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->container['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]);
        }
    }
964274
public function handle()
	{
		$context = $this->getLaravel()->make( 'Aimeos\Shop\Base\Context' )->get( false, 'command' );
		$context->setEditor( 'aimeos:cache' );

		$localeManager = \Aimeos\MShop::create( $context, 'locale' );

		foreach( $this->getSiteItems( $context, $this->argument( 'site' ) ) as $siteItem )
		{
			$localeItem = $localeManager->bootstrap( $siteItem->getCode(), '', '', false );

			$lcontext = clone $context;
			$lcontext->setLocale( $localeItem );

			$cache = new \Aimeos\MAdmin\Cache\Proxy\Standard( $lcontext );
			$lcontext->setCache( $cache );

			$this->info( sprintf( 'Clearing the Aimeos cache for site "%1$s"', $siteItem->getCode() ) );

			\Aimeos\MAdmin::create( $lcontext, 'cache' )->getCache()->clear();
		}
	}
1169451
public function handle()
    {
        if (parent::handle() === false && ! $this->option('force')) {
            return;
        }

        if ($this->option('all')) {
            $this->input->setOption('controller', true);
            $this->input->setOption('factory', true);
            $this->input->setOption('migration', true);
            $this->input->setOption('resource', true);
        }

        if ($this->option('factory')) {
            $this->createFactory();
        }

        if ($this->option('migration')) {
            $this->createMigration();
        }

        if ($this->option('controller') || $this->option('resource')) {
            $this->createController();
        }
    }
724974
public function handle()
    {
        if (!$this->confirmToProceed()) {
            return;
        }

        // Next we'll gather some of the options so that we can have the right options
        // to pass to the commands. This includes options such as which database to
        // use and the path to use for the migration. Then we'll run the command.
        $database = $this->input->getOption('database');

        $path = $this->input->getOption('path');

        $force = $this->input->getOption('force');

        // If the "step" option is specified it means we only want to rollback a small
        // number of migrations before migrating again. For example, the user might
        // only rollback and remigrate the latest four migrations instead of all.
        $step = $this->input->getOption('step') ?: 0;

        if ($step > 0) {
            $this->runRollback($database, $path, $step, $force);
        } else {
            $this->runReset($database, $path, $force);
        }

        // The refresh command is essentially just a brief aggregate of a few other of
        // the migration commands and just provides a convenient wrapper to execute
        // them in succession. We'll also see if we need to re-seed the database.
        $this->call(
            'mongolid-migrate',
            [
                '--database' => $database,
                '--path' => $path,
                '--realpath' => $this->input->getOption('realpath'),
                '--force' => $force,
            ]
        );

        if ($this->needsSeeding()) {
            $this->runSeeder($database);
        }
    }
5296
protected function execute(Input\InputInterface $input, Output\OutputInterface $output)
    {
        $this->generatorService->process($input->getOption('force'));
        $output->writeln('Completed');
    }
748013
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->initialiseWorker($input, $output);
        $id = $input->getOption("id");
        $identifier = intval($id);
        if (strstr($id, ",")) {
            $ids = explode(",", $id);
            foreach ($ids as $identifier) {
                if (intval($identifier) > 0) {
                    $this->regenerateTaskById($identifier);
                }
            }
        } elseif ($identifier > 0) {
            $this->regenerateTaskById(intval($id));
        }
    }
544506
public function fire()
    {
        $instance  = $this->argument('instance');
        $template  = $this->option('template');
        $force     = $this->option('force');
        $merge     = $this->option('merge');
        $namespace = config('admin-generator.namespace');
        $engine    = config("admin-generator.instances.{$instance}.engine");

        if ( ! $namespace) {
            $this->error("The config 'namespace' in 'config/admin-generator.php' can not be empty, general set it to 'console'");
            exit;
        }

        if ( ! config("admin-generator.instances.{$instance}")) {
            $this->warn("The instance '{$instance}' is not exist, check the typo or add it to config/admin-generator.php first");
            exit;
        }

        if ( ! $engine) {
            $this->warn("The engine of instance '{$instance}' is not exist, check the typo or add it to config/admin-generator.php first");
        }

        $templates = $this->getTemplates($template, $merge, $engine);

        $files = $this->getMergedFiles($templates, $engine);

        $filesystem = new Filesystem();

        foreach ($files as $src) {
            $destName = $this->getFileDest($src, $engine);

            $destName = $this->replaceKeyword($destName);

            if (is_file($destName) && ! $force) {
                $this->error(sprintf("The file %s is already exist, use option '--force' to override it", str_replace(base_path() . '/', '', $destName)));
                exit;
            } else {
                $this->info(sprintf("Copying file to %s", str_replace(base_path() . '/', '', $destName)));
            }

            $content  = $filesystem->get($src);
            $replaced = $this->replaceKeyword($content);

            $filesystem->put($destName, $replaced);
        }

        $this->warn('Done! Please config route and menu in app.coffee and MenuController.coffee');
    }
1067796
public function handle()
    {
        if (! $this->confirmToProceed()) {
            return;
        }

        $this->resolver->setDefaultConnection($this->getDatabase());

        Model::unguarded(function () {
            $this->getSeeder()->__invoke();
        });

        $this->info('Database seeding completed successfully.');
    }
364149
public function handle()
    {
        $this->input->getOption('force') and $this->builder->setForce(true);

        $this->input->getOption('gzip') and $this->builder->setGzip(true);

        if ($production = $this->input->getOption('production'))
        {
            $this->comment('Starting production build...');
        }
        else
        {
            $this->comment('Starting development build...');
        }

        $collections = $this->gatherCollections();

        if ($this->input->getOption('gzip') and ! function_exists('gzencode'))
        {
            $this->error('[gzip] Build will not use Gzip as the required dependencies are not available.');
            $this->line('');
        }

        foreach ($collections as $name => $collection)
        {
            if ($production)
            {
                $this->buildAsProduction($name, $collection);
            }
            else
            {
                $this->buildAsDevelopment($name, $collection);
            }

            $this->cleaner->clean($name);
        }
    }
31384
protected function execute(InputInterface $input, OutputInterface $output)
    {
        if (! $this->allowSudo and ! $this->requireSudo and $this->hasRootAccess()) {
            $this->error('Cannot execute this command with root privileges');
            exit;
        }

        if ($this->requireSudo and ! $this->hasRootAccess()) {
            $this->error('This command requires root privileges');
            exit;
        }
        $this->getLaravel()->make('events')->fire('command.firing', $this->name);
        $return = null;
        if (method_exists($this, 'handle')) {
            $return = $this->handle();
        }
        if (method_exists($this, 'fire')) {
            $return = $this->fire();
        }
        $this->getLaravel()->make('events')->fire('command.fired', $this->name);

        return $return;
    }
256119
public function handle ()
    {
        $this->welcomeMessage ();
        $this->info ("Environment configuration:");

        if (file_exists ('.env')) {
            unlink ('.env');
        }

        $this->configureEnvironment ();

        // generate application key
        $this->call ('key:generate');

        $this->comment ('-');

        $this->info ("Next step during installation: \n");
        $this->info ("php artisan hc:update \n");
    }
303163
public function handle()
    {
        $exists = false;

        if (File::exists($this->publishedSeederRealpath())) {
            $exists = true;

            if (!$this->confirm('The seeder file already exists, overwrite it? [Yes|no]')) {
                return $this->info('Okay, no changes made to the file.');
            }
        }

        try {
            if(! $exists) {
                $this->callSilent('make:seed', ['name' => substr($this->seeder_file, 0, strpos($this->seeder_file, '.'))]);
            }
        } catch (\Exception $ex) {

        }

        $inputFile = file_get_contents($this->localSeederPath());

        $outputFile = fopen($this->publishedSeederRealpath(), 'w');

        if ($inputFile && $outputFile) {
            fwrite($outputFile, $inputFile);

            fclose($outputFile);
        } else {
            File::delete($this->publishedSeederRealpath());

            return $this->error(
                        'There was an error creating the seeder file, '
                        .'check write permissions for ' . base_path('database') . DIRECTORY_SEPARATOR . 'seeds'
                        .PHP_EOL
                        .PHP_EOL
                        .'If you think this is a bug, please submit a bug report '
                        .'at https://github.com/moharrum/laravel-geoip-world-cities/issues'
                    );
        }

        if(! $exists) {
            $this->info('Okay, seeder file created successfully.');

            return;
        }

        $this->info('Okay, seeder file overwritten successfully.');
    }
177259
final public static function register(Factory $factory) {
        if(!isset(self::$factories[$factory->driver]))
            self::$factories[$factory->driver] = $factory;
    }
937468
public function handle()
    {

        $this->line('SeAT Diagnostics');
        $this->line('If you are not already doing so, it is recommended that you ' .
            'run this as the user the workers are running as.');
        $this->line('Eg:');
        $this->info('    sudo -u apache php artisan seat:admin:diagnose');
        $this->info('    su -c "php artisan seat:admin:diagnose" -s /bin/sh www-data');
        $this->line('This helps to check whether the permissions are correct.');
        $this->line('');

        $this->environment_info();
        $this->line('');

        $this->check_debug();
        $this->line('');

        $this->check_storage();
        $this->line('');

        $this->check_database();
        $this->line('');

        $this->check_redis();
        $this->line('');

        $this->check_pheal();
        $this->line('');

        $this->call('seat:version');

        $this->line('SeAT Diagnostics complete');

    }
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);
    }