Execute the command.

@return void
484793
public function handle()
    {
        parent::handle();

        if ($this->option('models')) {
            $this->models = explode(',', $this->option('models'));
        }

        if ($this->option('models')) {
            $this->models = explode(',', $this->option('models'));
        }

        // TODO: compare the length option

        $configData = $this->getConfigData();

        // get message config by locale
        $locale = config('app.locale');
        $configMessages = config('generator.message');
        if (isset($configMessages[$locale])) {
            $messages = $configMessages[$locale];
        } else {
            $messages = $configMessages['en'];
        }
        $configData = array_merge([
            'MESSAGE_STORE'     => "'".str_replace(':model', '$MODEL_NAME$', $messages['store'])."'",
            'MESSAGE_UPDATE'    => "'".str_replace(':model', '$MODEL_NAME$', $messages['update'])."'",
            'MESSAGE_DELETE'    => "'".str_replace(':model', '$MODEL_NAME$', $messages['delete'])."'",
            'MESSAGE_NOT_FOUND' => "'".str_replace(':model', '$MODEL_NAME$', $messages['not_found'])."'",
        ], $configData);

        // init generators
        $routeGenerator = new RoutesGenerator($this);
        $modelGenerator = new ModelGenerator($this);

        $useRepositoryLayer = config('generator.use_repository_layer', true);
        if ($useRepositoryLayer) {
            $repositoryGenerator = new RepositoryGenerator($this);
            $repositoryGenerator->askMakeBaseRepository();
        }

        $useServiceLayer = config('generator.use_service_layer', true);
        if ($useServiceLayer) {
            $serviceGenerator = new ServiceGenerator($this);
        }

        $requestGenerator    = new RequestGenerator($this);
        $controllerGenerator = new ControllerGenerator($this);
        $viewGenerator       = new ViewGenerator($this);

        // generate files for every table
        foreach ($this->tables as $idx => $tableName) {
            if (isset($this->models[$idx])) {
                $modelName = $this->models[$idx];
            } else {
                $modelName = str_singular(studly_case($tableName));
            }

            $this->comment('Generating scaffold for: '. $tableName);

            $data = array_merge($configData, [
                'TABLE_NAME'              => $tableName,
                'MODEL_NAME'              => $modelName,
                'MODEL_NAME_CAMEL'        => camel_case($modelName),
                'MODEL_NAME_PLURAL'       => str_plural($modelName),
                'MODEL_NAME_PLURAL_LOWER' => strtolower(str_plural($modelName)),
                'MODEL_NAME_PLURAL_CAMEL' => camel_case(str_plural($modelName)),
                'RESOURCE_URL'            => str_slug($tableName),
                'RESOURCE_SLUG'           => str_singular($tableName),
                'VIEW_FOLDER_NAME'        => snake_case($tableName)
            ]);

            // update route
            $routeGenerator->generate($data);

            // create a model
            $modelGenerator->generate($data);

            if (isset($repositoryGenerator)) {
                // create a repository
                $repositoryGenerator->generate($data);
            }

            if (isset($serviceGenerator)) {
                // create a service
                $serviceGenerator->generate($data);
            }

            // create request files
            $requestGenerator->generate($data);

            // create a controller
            $controllerGenerator->generate($data);
        
            // create a view folder
            $viewGenerator->fillableColumns = $modelGenerator->fillableColumns;
            $viewGenerator->generate($data);
        }
    }
487855
public function handle()
    {

        $this->exceptionName = $this->formatModel($this->argument('ExceptionName'));

        $this->view = $this->formatModelPath($this->exceptionName);

        $this->setCommandType($this->argument('command'));

        $this->setExceptionPaths();

        if ( $this->deleteFiles() ) {

            $this->sendSuccessMessage();

            return;

        }

        $this->error('No Such Directory');


    }
185731
public function handle()
    {
        if (! $this->preflighted()) return;

        $character_ids = User::doesntHave('refresh_token')
                ->select('id')
                ->where('id', '<>', 1)
                ->get()
                ->pluck('id');

        $character_ids->each(function ($character_id) {

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

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

            CharacterInfo::firstOrNew(['character_id' => $character_id])->fill([
                'name'            => $character_info->name,
                'description'     => $character_info->optional('description'),
                'corporation_id'  => $character_info->corporation_id,
                'alliance_id'     => $character_info->optional('alliance_id'),
                'birthday'        => $character_info->birthday,
                'gender'          => $character_info->gender,
                'race_id'         => $character_info->race_id,
                'bloodline_id'    => $character_info->bloodline_id,
                'ancestry_id'    => $character_info->optional('ancestry_id'),
                'security_status' => $character_info->optional('security_status'),
                'faction_id'      => $character_info->optional('faction_id'),
            ])->save();
        });
    }
736931
public function handle()
    {
        if (count($this->models) === 0) {
            return;
        }

        $this->models->first()->searchableUsing()->update($this->models);
    }
630812
public function handle()
    {
        try {
            $role = App::make(config('commands.role'));

            $role::create([
                'name' => $this->ask('Name?')
            ]);
            $this->info('Role created');
        } catch (\Exception $exception) {
            $this->error($exception->getMessage());
        }
    }
388784
public function handle()
    {
        // Load Data
        $stats   = $this->logViewer->statsTable('en');

        $rows    = $stats->rows();
        $rows[]  = $this->tableSeparator();
        $rows[]  = $this->prepareFooter($stats);

        // Display Data
        $this->displayLogViewer();
        $this->table($stats->header(), $rows);
    }
1325641
public function handle()
    {
        $this->line('');
        $this->line('************************');
        $this->line('  Welcome to Sco-Admin  ');
        $this->line('************************');

        $this->publish();
        $this->routes();

        $this->info('Successfully Installed Sco-Admin!');
    }
828856
public function handle(): void
    {
        $this->translations = Translation::all();
        $this->translation_groups = TranslationGroup::all();
	    
        $this->getAllLanguagesFromTable();
        $this->generateLanguageFolders();
        $this->generateGroupFiles();
        $this->generateFileContentArray();
        $this->distributeArrayToFiles();
    }
53484
public function handle()
    {
        if ($package = $this->option('package')) {
            $this->manager->setPathToVendorPackage($package);
        }

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

        if (empty($this->files)) {
            $this->warn('No language files were found!');
        }

        $languages = $this->manager->languages();

        $this->table(
            array_merge(['key'], $languages),
            $this->tableRows()
        );
    }
236846
public function handle()
    {
        $this->basePath = $this->getMigrationPath();
        $migrations = $this->migrator->getMigrationFiles($this->basePath);
        $count = count($migrations);

        if ($count == 0) {
            $this->comment('No migrations to move');

            return;
        }

        foreach ($migrations as $migration_name => $migration_path) {
            $datePath = $this->migrator->getDateFolderStructure($migration_name);
            // Move the migration into base migration folder
            $this->files->move($this->basePath.'/'.$datePath.$migration_name.'.php', $this->basePath.'/'.$migration_name.'.php');
        }

        $this->info('Migrations disorganised successfully ('.$count.' migrations moved)');
        $this->cleanup();
    }
326173
public function handle()
    {
        $this->abortCommandExecution();
        $this->remotePath = $this->domain . '/.env';
        $this->runScp($this->localPath, $this->remotePath, null, true);
    }
378860
public function handle()
    {
        $rule = $this->option('rule');
        /**
         * @var Cdn $cdn
         */
        $cdn = app()->makeWith(Cdn::class, ['rule' => $rule]);
        $cdn->clearCdn($this->output);
    }
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());
    }
247443
public function handle()
    {
        $username = $this->argument('username');

        if ( ! $this->getAuthenticator()->deleteUser($username)) {
            $this->error("Failed to find or delete user '{$username}'");
            return;
        }

        $this->info('User deleted.');
    }
279248
public function handle()
    {
        User::create([
            'name' => $this->ask('Name?'),
            'email' => $this->ask('Email address?'),
            'password' => bcrypt($this->secret('Password?'))
        ]);
        
        $this->info('User saved');
    }
1248483
public function handle(): void
    {
        $start = $this->argument('start');
        $end = $this->argument('end');
        $disk = $this->argument('disk');

        $resources = $this->resourceService->getRepository()->makeQuery()
            ->select('id', 'path', 'mime_type')
            ->setEagerLoads([])
            ->skip($start)
            ->take($end)
            ->get();

        foreach ($resources as $resource) {
            $this->resourceService->createPreviewThumb(
                $resource->id,
                $resource->path,
                $resource->mime_type,
                $disk,
                [],
                true
            );
        }
    }
1291843
public function handle()
    {

        $connection = $this->option("connection") ? $this->option("connection") : config("es.default");
        $force = $this->option("force") ? $this->option("force") : 0;

        $client = $this->es->connection($connection)->raw();

        $indices = !is_null($this->argument('index')) ?
            [$this->argument('index')] :
            array_keys(config('es.indices'));

        foreach ($indices as $index) {

            if (!$client->indices()->exists(['index' => $index])) {
                $this->warn("Index: {$index} is not exist!");
                continue;
            }

            if ($force or $this->confirm("Are you sure to drop \"$index\" index")) {

                $this->info("Dropping index: {$index}");

                $client->indices()->delete(['index' => $index]);

            }

        }

    }