Execute the console command.

@return void

@throws \Exception
359122
public function handle()
    {
        chdir($this->laravel->basePath('public'));

        $this->line("<info>Laravel development server started:</info> <http://{$this->host()}:{$this->port()}>");

        passthru($this->serverCommand());
    }
1252870
public function handle()
    {
        $content = $this->filesystem->get(base_path() . '/.env');

        $key = config('app.key');

        $content = str_replace($key, Str::random(), $content);

        $this->filesystem->create(base_path() . '/.env', $content);

        $this->info("Application key set successfully.");
    }
279248
public function handle()
    {
        User::create([
            'name' => $this->ask('Name?'),
            'email' => $this->ask('Email address?'),
            'password' => bcrypt($this->secret('Password?'))
        ]);
        
        $this->info('User saved');
    }
558
public function handle()
    {
        $indexConfigurator = $this->getIndexConfigurator();

        if ($indexConfigurator && ! $this->alreadyExists($indexConfigurator)) {
            $this->call('make:index-configurator', [
                'name' => $indexConfigurator,
            ]);
        }

        $searchRule = $this->getSearchRule();

        if ($searchRule && ! $this->alreadyExists($searchRule)) {
            $this->call('make:search-rule', [
                'name' => $searchRule,
            ]);
        }

        parent::handle();
    }
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);
    }
460695
public function handle()
    {
        $this->getApplication()->setCatchExceptions(false);

        $config = new Configuration([
            'updateCheck' => 'never',
        ]);

        $config->getPresenter()->addCasters(
            $this->getCasters()
        );

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

        $path = $this->getLaravel()->basePath().DIRECTORY_SEPARATOR.'vendor/composer/autoload_classmap.php';

        $loader = ClassAliasAutoloader::register($shell, $path);

        try {
            $shell->run();
        } finally {
            $loader->unregister();
        }
    }
828856
public function handle(): void
    {
        $this->translations = Translation::all();
        $this->translation_groups = TranslationGroup::all();
	    
        $this->getAllLanguagesFromTable();
        $this->generateLanguageFolders();
        $this->generateGroupFiles();
        $this->generateFileContentArray();
        $this->distributeArrayToFiles();
    }
504711
public function handle()
    {
        $p = $this->option('p');
        $f = $this->option('f');
        $t = $this->option('t');
        $path    = realpath(base_path());
        $appPath    = realpath(app_path());
        if($p !== null && $p !=='all') {
            if($f == 'app') {
                $hooks = $this->files->glob($appPath.'/'.$p.'/Hook/config.php');
            } else {
                $hooks = $this->files->glob($path.'/'.$p.'/Hook/config.php');
            }
            if($hooks) {
                $hookLists = $this->files->getRequire($hooks[0])['hookList'];
                $hookInjects = $this->files->getRequire($hooks[0])['hookInject'];
                $this->initHook($hookLists, $t);
                $this->initHookInject($hookInjects, $t);
            }
        } else if($p !== null && $p === 'all') {
            // $defaultHookList = config('hook.default.hookList');
            // $defaulHookInject = config('hook.default.hookInject');
            // $this->initHook($defaultHookList);
            // $this->initHookInject($defaulHookInject);
            $hooks = $this->files->glob($appPath.'/Hook/config.php');
            if($hooks) {
                $hookLists = $this->files->getRequire($hooks[0])['hookList'];
                $hookInjects = $this->files->getRequire($hooks[0])['hookInject'];
                $this->initHook($hookLists);
                $this->initHookInject($hookInjects);
            }
            $mhooks = $this->files->glob($appPath.'/Modules/*/Hook/config.php');
            if($mhooks) {
                foreach ($mhooks as $hook) {
                    $hookLists = $this->files->getRequire($hook)['hookList'];
                    $hookInjects = $this->files->getRequire($hook)['hookInject'];
                    $this->initHook($hookLists);
                    $this->initHookInject($hookInjects);
                }
            }
            $vhooks = $this->files->glob($path.'/vendor/huasituo/*/src/Hook/config.php');
            if($vhooks) {
                foreach ($vhooks as $hook) {
                    $hookLists = $this->files->getRequire($hook)['hookList'];
                    $hookInjects = $this->files->getRequire($hook)['hookInject'];
                    $this->initHook($hookLists);
                    $this->initHookInject($hookInjects);
                }
            }
        }
        $data = HookModel::setCache();
        $injectAll = HookInjectModel::setAllCache();
        $inject = HookInjectModel::setCache();
        $this->info('hook cache ok!');
    }
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('');

        }
    }
1328179
public function handle()
    {
        $group = $this->argument('group');
        $json = $this->option('json');

        if (is_null($group) && !$json) {
            $this->warn('You must either specify a group argument or export as --json');

            return;
        }

        if (!is_null($group) && $json) {
            $this->warn('You cannot use both group argument and --json option at the same time');

            return;
        }

        $this->manager->exportTranslations($group, $json);

        if (!is_null($group)) {
            $this->info('Done writing language files for '.(($group == '*') ? 'ALL groups' : $group.' group'));
        } elseif ($json) {
            $this->info('Done writing JSON language files for translation strings');
        }
    }
5737
public function handle()
    {
        $this->processOptions();
        $this->checkIfSpatieMenuAlreadyInstalled();
        $this->installSpatieMenu();
        $this->publishSpatieMenu();
        $this->publishSpatieMenuConfig();
    }
1154966
public function handle()
    {
        $this->addon = $this->getAddon();

        if (parent::handle() !== false) {
            if ($this->option('migration')) {
                $table = $this->toTable($this->argument('name'));

                $this->call('make:migration', [
                    'name' => $this->option('migration'),
                    '--addon' => $this->option('addon'),
                    '--create' => $table,
                ]);
            }
        }
    }
281194
public function handle()
    {
        $params = [
            'tables'   => $this->argument('tables'),
            '--tables' => $this->option('tables'),
            '--ignore' => $this->option('ignore'),
        ];

        $this->call('generator:make:migration', $params);

        $params['--models'] = $this->option('models');

        $this->call('generator:make:scaffold', $params);

        $this->call('generator:make:factory', $params);
    }
215655
public function handle()
    {
        if (!in_array($this->argument('type'), [
            CommandData::$COMMAND_TYPE_API,
            CommandData::$COMMAND_TYPE_SCAFFOLD,
            CommandData::$COMMAND_TYPE_API_SCAFFOLD,
            CommandData::$COMMAND_TYPE_VUEJS,
        ])) {
            $this->error('invalid rollback type');
        }

        $this->commandData = new CommandData($this, $this->argument('type'));
        $this->commandData->config->mName = $this->commandData->modelName = $this->argument('model');

        $this->commandData->config->init($this->commandData, ['tableName', 'prefix']);

        $migrationGenerator = new MigrationGenerator($this->commandData);
        $migrationGenerator->rollback();

        $modelGenerator = new ModelGenerator($this->commandData);
        $modelGenerator->rollback();

        $repositoryGenerator = new RepositoryGenerator($this->commandData);
        $repositoryGenerator->rollback();

        $requestGenerator = new APIRequestGenerator($this->commandData);
        $requestGenerator->rollback();

        $controllerGenerator = new APIControllerGenerator($this->commandData);
        $controllerGenerator->rollback();

        $routesGenerator = new APIRoutesGenerator($this->commandData);
        $routesGenerator->rollback();

        $requestGenerator = new RequestGenerator($this->commandData);
        $requestGenerator->rollback();

        $controllerGenerator = new ControllerGenerator($this->commandData);
        $controllerGenerator->rollback();

        $viewGenerator = new ViewGenerator($this->commandData);
        $viewGenerator->rollback();

        $routeGenerator = new RoutesGenerator($this->commandData);
        $routeGenerator->rollback();

        $controllerGenerator = new VueJsControllerGenerator($this->commandData);
        $controllerGenerator->rollback();

        $routesGenerator = new VueJsRoutesGenerator($this->commandData);
        $routesGenerator->rollback();

        $viewGenerator = new VueJsViewGenerator($this->commandData);
        $viewGenerator->rollback();

        $modelJsConfigGenerator = new ModelJsConfigGenerator($this->commandData);
        $modelJsConfigGenerator->rollback();

        if ($this->commandData->getAddOn('tests')) {
            $repositoryTestGenerator = new RepositoryTestGenerator($this->commandData);
            $repositoryTestGenerator->rollback();

            $testTraitGenerator = new TestTraitGenerator($this->commandData);
            $testTraitGenerator->rollback();

            $apiTestGenerator = new APITestGenerator($this->commandData);
            $apiTestGenerator->rollback();
        }

        if ($this->commandData->config->getAddOn('menu.enabled')) {
            $menuGenerator = new MenuGenerator($this->commandData);
            $menuGenerator->rollback();
        }

        $this->info('Generating autoload files');
        $this->composer->dumpOptimized();
    }
1274894
public function handle()
    {
        $this->abortCommandExecution();
        $file = $this->argument('file');
        $this->runScp(base_path($file), $this->domain, null, true);
    }
150941
public function handle()
    {
        $name = $this->parseName($this->getNameInput());

        $path = $this->getPath($name);

        if ($this->alreadyExists($this->getNameInput())) {
            $this->error($this->type . " \"{$name}\" already exists!");

            return;
        }

        if (! $this->checkOptions()) {
            return;
        }

        $this->makeDirectory($path);

        $this->files->put($path, $this->buildClass($name));

        $this->info($this->type . " \"{$name}\" created successfully.");

        // If also needs a new model file
        if ($model = $this->option('create')) {
            $this->call('make:model', ['name' => $model]);
        }
    }
370255
public function handle()
    {
        if (!in_array($this->argument('type'), [
            CommandData::$COMMAND_TYPE_API,
            CommandData::$COMMAND_TYPE_SCAFFOLD,
            CommandData::$COMMAND_TYPE_API_SCAFFOLD,
        ])) {
            $this->error('invalid rollback type');
        }

        $this->commandData = new CommandData($this, $this->argument('type'));
        $this->commandData->config->mName = $this->commandData->modelName = $this->argument('model');

        $this->commandData->config->prepareOptions($this->commandData, ['tableName', 'prefix']);
        $this->commandData->config->prepareAddOns();
        $this->commandData->config->prepareModelNames();
        $this->commandData->config->prepareTableName();
        $this->commandData->config->loadPaths();
        $this->commandData->config->loadNamespaces($this->commandData);
        $this->commandData = $this->commandData->config->loadDynamicVariables($this->commandData);

        $migrationGenerator = new MigrationGenerator($this->commandData);
        $migrationGenerator->rollback();

        $modelGenerator = new ModelGenerator($this->commandData);
        $modelGenerator->rollback();

        $repositoryGenerator = new RepositoryGenerator($this->commandData);
        $repositoryGenerator->rollback();

        $requestGenerator = new APIRequestGenerator($this->commandData);
        $requestGenerator->rollback();

        $controllerGenerator = new APIControllerGenerator($this->commandData);
        $controllerGenerator->rollback();

        $routesGenerator = new APIRoutesGenerator($this->commandData);
        $routesGenerator->rollback();

        $requestGenerator = new RequestGenerator($this->commandData);
        $requestGenerator->rollback();

        $controllerGenerator = new ControllerGenerator($this->commandData);
        $controllerGenerator->rollback();

        $viewGenerator = new ViewGenerator($this->commandData);
        $viewGenerator->rollback();

        $routeGenerator = new RoutesGenerator($this->commandData);
        $routeGenerator->rollback();

        if ($this->commandData->getAddOn('tests')) {
            $repositoryTestGenerator = new RepositoryTestGenerator($this->commandData);
            $repositoryTestGenerator->rollback();

            $testTraitGenerator = new TestTraitGenerator($this->commandData);
            $testTraitGenerator->rollback();

            $apiTestGenerator = new APITestGenerator($this->commandData);
            $apiTestGenerator->rollback();
        }

        if ($this->commandData->config->getAddOn('menu.enabled')) {
            $menuGenerator = new MenuGenerator($this->commandData);
            $menuGenerator->rollback();
        }

        $this->info('Generating autoload files');
        $this->composer->dumpOptimized();
    }