Execute the console command.

@return mixed
766093
public function handle()
    {
        $seeder = ['ManageUser', 'CommonConfig', 'CommonRole', 'CommonRoleUri', 'ManageMenu'];
        if($seeder) {
            if($this->option('table')) {
                if(in_array($this->option('table'), $seeder)) {
                    $fullPath = 'Huasituo\Hstcms\Database\Seeds\\'.$this->option('table').'TableSeeder';
                    $this->seed($fullPath, $this->option('table'));
                }
            } else {
                foreach ($seeder as $key => $value) {
                    $fullPath = 'Huasituo\Hstcms\Database\Seeds\\'.$value.'TableSeeder';
                    $this->seed($fullPath, $value);
                }
            }
        }
    }
470604
public function handle()
    {
        $options = $this->options();
        foreach (['host', 'port', 'username', 'secret'] as $key) {
            $value = Arr::get($options, $key, null);
            $value = is_null($value) ? Arr::get($this->config, $key, null) : $value;
            $options[$key] = $value;
        }
        $client = $this->connector->create($options);
        $client->then([$this, 'client'], [$this, 'writeException']);
        $this->loop->run();
    }
920736
public function handle()
    {
        $type = $this->option('type');

        if (! is_null($type) && ! in_array($type, array('package', 'module', 'theme'))) {
            return $this->error("Invalid Packages type [$type].");
        }

        $packages = $this->getPackages($type);

        if (empty($packages)) {
            if (! is_null($type)) {
                return $this->error("Your application doesn't have any Packages of type [$type].");
            }

            return $this->error("Your application doesn't have any Packages.");
        }

        $this->displayPackages($packages);
    }
788981
public function handle()
    {
        $sql = $this->option('command');
        $connection = $this->databaseManager->connection($this->option('connection'));
        $rows = $this->castArray($connection->select($sql, [], true));
        $headers = array_keys(Arr::get($rows, 0, []));
        $this->table($headers, $rows);
    }
447624
public function handle()
    {
        $id = $this->argument('id');

        try {
            $user = $this->prepareUser($id);
        } catch (Exception $e) {
            $this->warn($e->getMessage());
            return 1;
        }

        echo "User name: {$user->name} (ID = {$user->id})", PHP_EOL;
        echo "Created at: {$user->created_at}", PHP_EOL;
        echo "Updated at: {$user->updated_at}", PHP_EOL;

        $this->show($user, 'role');
        $this->show($user, 'permission');

        return 0;
    }
110632
public function handle()
    {
    	if ($this->confirm('Do you want to install it?', false)) {
            Artisan::call('vendor:publish',['--tag' => 'admin_migrations']);
	    	Artisan::call('vendor:publish',['--tag' => 'admin_seeds']);
	    	Artisan::call('vendor:publish',['--tag' => 'admin_public']);
	    	Artisan::call('vendor:publish',['--tag' => 'admin_views']);
	    	exec('composer dump-autoload');
	    	Artisan::call('migrate');
	    	Artisan::call('db:seed',['--class' => 'UsersTableSeeder']);

	    	$this->displayOutput();
        }
    	

    }
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);
    }
1355624
public function handle()
    {

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

        $this->modelPath = $this->formatModelPath($this->argument('ParentName'));

        $this->childName = $this->formatModel($this->argument('ChildName'));

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

        $this->setRelationshipPath();

        if ( $this->extractMethodsFromFiles() ) {

            $this->sendParentSuccessMessage();



        } else {

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

        }


        $this->clearFilePaths();

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

        $this->modelPath = $this->formatModelPath($this->argument('ChildName'));

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

        $this->setCrudPaths();

        if ( $this->deleteFiles() ) {

            $this->sendChildSuccessMessage();


        } else {

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

        }

        $this->clearFilePaths();


        $this->folderName = $this->formatModelPath($this->argument('ChildName'));

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

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

        $this->setViewPaths();

        $path = base_path('resources/views/'. $this->folderName);

        if ( $this->removeViewFolder($path) && $this->deleteFiles() ) {

            return $this->sendChildViewsSuccessMessage();

        }

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


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

        $this->migrator->setConnection($this->option('database'));
        
        $repository = modules()->location($this->option('location'));
        $paths      = $this->getMigrationPaths($repository);

        $this->migrator->setOutput($this->output)->rollback(
            $paths, ['pretend' => $this->option('pretend'), 'step' => (int)$this->option('step')]
        );
    }
1118801
public function handle()
    {
        if (!$this->confirmToProceed()) {
            return;
        }

        $database = $this->connection->tenantName();

        $this->input->setOption('force', $force = true);
        $website_id = $this->option('website_id');
        $realpath = $this->option('realpath');
        $path = $this->input->getOption('path');
        $step = $this->input->getOption('step') ?? 0;

        if ($step > 0) {
            $this->call('tenancy:migrate:rollback', [
                '--database' => $database,
                '--realpath' => $realpath,
                '--website_id' => $website_id,
                '--path' => $path,
                '--step' => $step,
                '--force' => $force,
            ]);
        } else {
            $this->call('tenancy:migrate:reset', [
                '--database' => $database,
                '--realpath' => $realpath,
                '--website_id' => $website_id,
                '--path' => $path,
                '--force' => $force,
            ]);
        }

        $this->call('tenancy:migrate', [
            '--database' => $database,
            '--realpath' => $realpath,
            '--website_id' => $website_id,
            '--path' => $path,
            '--force' => $force,
        ]);

        if ($this->needsSeeding()) {
            $this->call('tenancy:db:seed', [
                '--database' => $database,
                '--class' => $this->option('seeder') ?? config('tenancy.db.tenant-seed-class') ?? 'DatabaseSeeder',
                '--force' => $force,
            ]);
        }
    }
360404
public function handle()
    {
        $id = $this->argument('id');
        $rule = $this->argument('rule');

        if( $id && $rule ) {
            $this->generateThumbByRule($id, $rule);
        } else {
            if( $id ) {
                $this->generateGlobalThumb($id);
            } else {

                if( $this->confirm('Are you sure you want to generate thumbs for all resources?') ) {
                    $list = HCResources::all()->pluck('id');

                    foreach ( $list as $id )
                        $this->generateGlobalThumb($id);
                }
            }
        }
    }
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);
            }
        }
    }
12692
public function handle()
    {
        $filesystem = new Filesystem;
        $filesystem->copyDirectory(
            __DIR__ . '/stubs/install',
            base_path()
        );
        $this->call('storage:link');

        if ($this->option('migrate')) {
            $this->call('migrate', ['--path' => str_replace(base_path(), '', __DIR__) . '/../../migrations']);
            $this->call('db:seed', ['--class' => \Kaiwh\Admin\Seeds\InitAdminSeeder::class]);
        }
    }
1185488
public function handle()
    {
        $this->events->fire('command.updating', $this);
        $this->events->fire('command.cacheconfig', $this);
        $this->events->fire('command.cacheroutes', $this);
        $this->events->fire('command.publishvendors', $this);
        $this->events->fire('command.runmigrations', $this);
        $this->events->fire('command.updatecache', $this);
        $this->events->fire('command.extrastuff', $this);
        $this->events->fire('command.updated', $this);
    }
940513
public function handle()
    {
        $targetName = $this->getTargetName();
        $name       = $this->parseName($targetName);

        return $this->generate($name, $this->getAdditionalData());
    }
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);
    }
1120339
public function handle()
    {
        $name = $this->argument('name');

        $error = $this->validateName($name);

        if ($error) {
            $this->error($error);
            return;
        }

        $key = ApiKey::where('name', $name)->first();

        if ($key->active) {
            $this->info('Key "' . $name . '" is already active');
            return;
        }

        $key->active = 1;
        $key->save();

        $this->info('Activated key: ' . $name);
    }