Execute the console command.

@return mixed
334624
public function handle()
    {
        $slug = $this->parseSlug($this->argument('slug'));
        $name = $this->parseName($this->argument('name'));

        if (! $this->packages->exists($slug)) {
            return $this->error('Package ['.$this->data['slug'].'] does not exist.');
        }

        $this->packageInfo = collect(
            $this->packages->where('slug', $slug)
        );

        // Check for a proper type of the
        $type = $this->packageInfo->get('type');

        if (($type != 'package') && ($type != 'module')) {
            return $this->error('Package [' .$this->data['slug'] .'] has no generator of this type.');
        }

        $this->packagesPath = ($type == 'module')
            ? $this->packages->getModulesPath()
            : $this->packages->getPackagesPath();

        $this->data['slug'] = $slug;
        $this->data['name'] = $name;

        return $this->generate();
    }
850465
public function handle()
	{
		$connection = $this->argument('connection') ?: $this->config->get('queue.default');
		$queue = $this->argument('queue') ?: $this->config->get('queue.connections.' . $connection  . '.queue');

		$this->info(sprintf('Clearing queue "%s" on "%s"', $queue, $connection));
		$cleared = $this->clearer->clear($connection, $queue);
		$this->info(sprintf('Cleared %d jobs', $cleared));
	}
211839
public function handle()
	{
		$days = (int)$this->option( 'days' );

		if ( $days < 0 )
		{
			$this->writeError( "days option cannot be negative" );

			return self::ERROR;
		}

		$success = $this->manager->deleteBackupFiles( $this->lang_folder_path , $days , $this->option( 'dry-run' ) );

		return ( $success === true ) ? self::SUCCESS : self::ERROR;
	}
555802
public function handle()
    {
        $version = $this->version();

        $all = $this->option('all');

        $currentOS = OperatingSystem::id();

        foreach ($this->slugs as $os => $slug) {
            if ($all || ($os === $currentOS)) {
                $archive = $this->download($version, $slug);

                $binary = $this->extract($archive);

                $this->rename($binary, $os);
            }
        }

        $message = 'ChromeDriver %s successfully installed for version %s.';

        $this->info(sprintf($message, $all ? 'binaries' : 'binary', $version));
    }
1011926
public function handle()
    {
        $disk = $this->argument('disk');
        $directory = $this->option('directory') ?: '';
        $non_recursive = (bool) $this->option('non-recursive');
        $force = (bool) $this->option('force');

        $this->call('media:prune', [
            'disk' => $disk,
            '--directory' => $directory,
            '--non-recursive' => $non_recursive,
        ]);

        $this->call('media:import', [
            'disk' => $disk,
            '--directory' => $directory,
            '--non-recursive' => $non_recursive,
            '--force' => $force,
        ]);
    }
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);
    }
1371808
public function handle()
    {
        $name = $this->argument('name');

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

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

        $apiKey       = new ApiKey;
        $apiKey->name = $name;
        $apiKey->key  = ApiKey::generate();
        $apiKey->save();

        $this->info('API key created');
        $this->info('Name: ' . $apiKey->name);
        $this->info('Key: '  . $apiKey->key);
    }
848963
public function handle()
    {

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

        $indices = $this->es->connection($connection)->raw()->cat()->indices();

        if (is_array($indices)) {
            $indices = $this->getIndicesFromArrayResponse($indices);
        } else {
            $indices = $this->getIndicesFromStringResponse($indices);
        }

        if (count($indices)) {
            $this->table($this->headers, $indices);
        } else {
            $this->warn('No indices found.');
        }

    }
555247
public function handle()
	{
		$tags = array_filter( explode( ',', $this->option( 'tags' ) ) );

		$cache = $this->cache->store( $store = $this->argument( 'store' ) );

		$this->laravel['events']->fire( 'cache:clearing', [$store, $tags] );

		if ( !empty( $tags ) )
		{
			$cache->tags( $tags )->flush();
		}
		else
		{
			$cache->flush();
		}

		$this->info( 'Cache cleared successfully.' );

		$this->laravel['events']->fire( 'cache:cleared', [$store, $tags] );
	}
985381
public function handle()
    {
        $name = $this->parseNameForDirectory($this->argument('name'));

        $headers = $this->generatePluginHeaders($name);

        $this->installPlugin($name);
        $this->setPluginHeaders($name, $headers);
        $this->setPluginRootFile($name);
        $this->setConfigurationFile($name, $headers);
        $this->setTranslationFile($name, $headers);
        $this->setProviders($name, $headers);

        $this->info('Plugin installed successfully.');
    }
1011598
public function handle()
    {

        $command = $this->argument('function') ? $this->argument('function') : 'create';
        $param = $this->argument('params') ? $this->argument('params') : '';
        if (is_callable([$this, $command])) {
            $this->$command($param);
        } else {
            $this->error(sprintf('%s command not found', $command));
        }
    }
610196
public function handle()
    {

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

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

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

        $this->setViewPaths();


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

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

            $this->sendSuccessMessage();

            return;

        }

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


    }
510608
public function handle()
    {
        $generator = FileGenerator::make($this->getRootDirectory(), $this->getStubDirectory());

        if ($this->generate($generator) === false) {
            return false;
        }

        $this->info($this->type.' created successfully.');
    }
1278498
public function handle()
    {
        $themeName = $this->argument('name');
        $argDirName = $this->argument('dirName');

        if ($argDirName && $themeName == $argDirName) {
            $argDirName = null;
        }

        if ($argDirName) {
            if (!preg_match('/^[a-z0-9\_\-]+$/i', $argDirName)) {
                return $this->error('Invalid destination directory name.');
            }

            if (Theme::exists($argDirName)) {
                return $this->error(sprintf('A theme named %s already exists.', $argDirName));
            }
        }

        try {
            $themeManager = ThemeManager::instance();
            $updateManager = UpdateManager::instance();

            $themeDetails = $updateManager->requestThemeDetails($themeName);

            if ($themeManager->isInstalled($themeDetails['code'])) {
                return $this->error(sprintf('The theme %s is already installed.', $themeDetails['code']));
            }

            if (Theme::exists($themeDetails['code'])) {
                return $this->error(sprintf('A theme named %s already exists.', $themeDetails['code']));
            }

            $fields = ['Name', 'Description', 'Author', 'URL', ''];

            $this->info(sprintf(
                implode(': %s'.PHP_EOL, $fields),
                $themeDetails['code'],
                $themeDetails['description'],
                $themeDetails['author'],
                $themeDetails['product_url']
            ));

            if (!$this->confirm('Do you wish to continue? [Y|n]', true)) {
                return;
            }

            $this->info('Downloading theme...');
            $updateManager->downloadTheme($themeDetails['code'], $themeDetails['hash']);

            $this->info('Extracting theme...');
            $updateManager->extractTheme($themeDetails['code'], $themeDetails['hash']);

            $dirName = $this->themeCodeToDir($themeDetails['code']);

            if ($argDirName) {
                /*
                 * Move downloaded theme to a new directory.
                 * Basically we're renaming it.
                 */
                File::move(themes_path().'/'.$dirName, themes_path().'/'.$argDirName);

                /*
                 * Let's make sure to unflag the 'old' theme as
                 * installed so it can be re-installed later.
                 */
                $themeManager->setUninstalled($themeDetails['code']);

                $dirName = $argDirName;
            }

            $this->info(sprintf('The theme %s has been installed. (now %s)', $themeDetails['code'], $dirName));
        }
        catch (Exception $ex) {
            $this->error($ex->getMessage());
        }
    }
1302044
public function handle()
    {
        if (!class_exists(Minify\Js::class)) {
            $this->error('To use `admin:minify` command, please install [matthiasmullie/minify] first.');
        }

        if ($this->option('clear')) {
            return $this->clearMinifiedFiles();
        }

        AdminFacade::bootstrap();

        $this->minifyCSS();
        $this->minifyJS();

        $this->generateManifest();

        $this->comment('JS and CSS are successfully minified:');
        $this->line('  '.Admin::$min['js']);
        $this->line('  '.Admin::$min['css']);

        $this->line('');

        $this->comment('Manifest successfully generated:');
        $this->line('  '.Admin::$manifest);
    }
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;
    }
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);
            }
        }
    }