Execute the console command.

@return mixed
541099
public function handle()
    {
        $rootPath = $this->getRootPath();
        $sourcePath = $this->getSourcePath();

        // Start Copying Files
        copy($sourcePath . 'aliases', $rootPath . 'aliases');
        copy($sourcePath . 'Homestead.yaml', $rootPath . 'Homestead.yaml');
        copy($sourcePath . 'Vagrantfile', $rootPath . 'Vagrantfile');

        if (!file_exists($rootPath . 'scripts'))
        {
            mkdir($rootPath . 'scripts');
            copy($sourcePath . 'scripts' . DIRECTORY_SEPARATOR . 'after.sh',
                $rootPath . 'scripts' . DIRECTORY_SEPARATOR . 'after.sh');
            copy($sourcePath . 'scripts' . DIRECTORY_SEPARATOR . 'blackfire.sh',
                $rootPath . 'scripts' . DIRECTORY_SEPARATOR . 'blackfire.sh');
            copy($sourcePath . 'scripts' . DIRECTORY_SEPARATOR . 'create-mysql.sh',
                $rootPath . 'scripts' . DIRECTORY_SEPARATOR . 'create-mysql.sh');
            copy($sourcePath . 'scripts' . DIRECTORY_SEPARATOR . 'create-postgres.sh',
                $rootPath . 'scripts' . DIRECTORY_SEPARATOR . 'create-postgres.sh');
            copy($sourcePath . 'scripts' . DIRECTORY_SEPARATOR . 'homestead.rb',
                $rootPath . 'scripts' . DIRECTORY_SEPARATOR . 'homestead.rb');
            copy($sourcePath . 'scripts' . DIRECTORY_SEPARATOR . 'serve.sh',
                $rootPath . 'scripts' . DIRECTORY_SEPARATOR . 'serve.sh');
            copy($sourcePath . 'scripts' . DIRECTORY_SEPARATOR . 'serve-hhvm.sh',
                $rootPath . 'scripts' . DIRECTORY_SEPARATOR . 'serve-hhvm.sh');

            $string = Inspiring::quote();
            $pieces = explode(' ', $string);
            $vbName = strtolower(array_pop($pieces));

            if ($this->option('name'))
            {
                $vbName = $this->option('name');
            }

            // Update virtualbox name
            $file = file_get_contents($rootPath . 'scripts' . DIRECTORY_SEPARATOR . 'homestead.rb');
            $newFile = str_replace("vb.name = 'homestead'", "vb.name = '" . $vbName . "'", $file);


            if ($this->option('hostname'))
            {
                $hostName = $this->option('hostname');
                $newFile = str_replace("settings[\"hostname\"] ||= \"homestead\"", "settings[\"hostname\"] ||= \"" . $hostName ."\"", $file);
            }

            file_put_contents($rootPath . 'scripts' . DIRECTORY_SEPARATOR . 'homestead.rb', $newFile);
        }
        else
        {
            $this->error('The scripts/ folder exists, please delete and run php artisan homeastead:create again.');
            die();
        }

        $this->info('Files Copied');
        $this->info('Ready to edit Homestead.yaml!');
    }
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]);
        }
    }
1094188
public function handle()
	{
		$this->mcustom($this->__directives);
		$this->mextend($this->__directory, $this->__extension);
		$this->mif();
		$this->mforeach();
		$this->mfor();
		$this->mswitch();
		$this->mwhile();
		$this->mecho();
		$this->msection();
		$this->mcode();
		$this->mcomment();
		return $this->__cached;
	}
100345
public function handle()
    {
        $this->currentRoot = trim($this->laravel->getNamespace(), '\\');

        $this->setAppDirectoryNamespace();
        $this->setBootstrapNamespaces();
        $this->setConfigNamespaces();
        $this->setComposerNamespace();
        $this->setDatabaseFactoryNamespaces();

        $this->info('Application namespace set!');

        $this->composer->dumpAutoloads();

        $this->call('optimize:clear');
    }
316506
public function handle()
    {
        $rootDirectory = $this->argument('directory') ?? '';

        if( $rootDirectory == '' ) {

            $files = $this->getConfigFiles();

            foreach ( $files as $file )
                $this->generateRoutes(realpath(implode('/', array_slice(explode('/', $file), 0, -3))) . '/');
        } else
            $this->generateRoutes($rootDirectory);
    }
1143649
public function handle()
    {
        try {
            $this->filesystem->make(
                $path = resource_path('views/' . $this->viewPath()),
                $this->filesystem->get($this->getStubPath()),
                true
            );
            $this->info('File ' . $path . ' created');
        } catch (\Exception $e) {
            $this->error($e->getMessage());
        }
    }
378925
public function handle()
    {
        $this->tables = $this->getTablesFromMWBFile();
        if ($this->tables === false) {
            return false;
        }
        $this->getAppJson();

        $success = $this->validateTableSchema();
        if (!$success) {
            return false;
        }

        $tableName = $this->option('table');
        if (!empty($tableName)) {
            $table = $this->findTableFromName($tableName);
            if (empty($table)) {
                $this->output('Table ( '.$tableName.' ) doesn\'t exist.', 'error');

                return false;
            }
            $this->tables = [$table];
        }

        $this->databaseService = new DatabaseService($this->config, $this->files);
        $this->databaseService->resetDatabase();

        $this->generateMigration();
        $this->generateModel();

        $this->styleCode();

        $this->databaseService->dropDatabase();

        return true;
    }
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());
        }
    }
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]);
        }
    }
932908
public function handle()
    {
        $location = $this->option('location');

        $this->container['slug']        = str_slug($this->argument('slug'));
        $this->container['name']        = studly_case($this->container['slug']);
        $this->container['version']     = '1.0';
        $this->container['description'] = 'This is the description for the ' . $this->container['name'] . ' module.';
        $this->container['location']    = $location ?: config('modules.default_location');
        $this->container['provider']    = config("modules.locations.{$this->container['location']}.provider");

        if ($this->option('quick')) {
            $this->container['basename']  = studly_case($this->container['slug']);
            $this->container['namespace'] = config("modules.locations.{$this->container['location']}.namespace").$this->container['basename'];

            return $this->generate();
        }

        $this->displayHeader('make_module_introduction');

        $this->stepOne();
    }
317600
public function handle()
    {
        $env = new Env(base_path('.env'));
        $key = strtoupper($this->argument('key'));
        $value = (string) $this->argument('value');
        $linebreak = (bool) $this->option('line-break');

        $result = $env->set($key, $value, $linebreak)->get($key);

        if ($result !== $value) {
            $env->rollback();

            return $this->error('Could not set the value in your .env file, reverting...');
        }

        return $this->comment("Successfully set [$key] to [$value] in your .env file.");
    }
1145887
public function handle()
    {
        $config = $this->container['config'];

        // Get the Language codes.
        $languages = array_keys(
            $config->get('languages', array())
        );

        if ($this->option('path')) {
            $path = $this->option('path');

            if (! $this->files->isDirectory($path)) {
                return $this->error('Not a directory: "' .$path .'"');
            } else if (! $this->files->isDirectory($path .DS .'Language')) {
                return $this->error('Not a translatable path: "' .$path .'"');
            }

            return $this->updateLanguageFiles($path, $languages);
        }

        // Was not specified a custom directory.
        else {
            $paths = $this->scanWorkPaths($config);
        }

        // Update the Language files in the available Domains.
        foreach ($paths as $path) {
            if (! $this->files->isDirectory($path)) {
                continue;
            } else if (! $this->files->isDirectory($path .DS .'Language')) {
                $this->comment('Not a translatable path: "' .$path .'"');

                continue;
            }

            $this->updateLanguageFiles($path, $languages);
        }
    }
218521
public function handle()
    {

        $connectionName = ! empty($this->argument('connection')) && $this->argument('connection') != 'null'
            ? $this->argument('connection') : config('database.default');
        $connection = config('database.connections.' . $connectionName);

        if (empty($connection)) {
            $this->info('No connection details');
            return false;
        }

        if ($connection['driver'] != 'mysql') {
            return $this->notMysql();
        }

        $cmd = $this->makeCommand($connection, $connectionName);

        try {
            exec($cmd);
        } catch (\Exception $e) {
            $this->info('There was an error');
            $this->info('Message: ' . $e->getMessage());
            $this->info('Trace: ' . $e->getTraceAsString());
            return false;
        }

    }
681188
public function handle()
	{
		if ($this->files->isDirectory($this->getPath(null))){
			return $this->error('Theme "'.$this->getTheme().'" is already exists.');
		}

		$this->makeDirs([
						'assets/css',
						'assets/js',
						'assets/img',
						'layouts',
						'partials/sections',
						'views',
						'widgets',
						]);

		$this->makeFiles([
						'layout.blade.php'	=> 'layouts/',
						'header.blade.php'	=> 'partials/',
						'footer.blade.php'	=> 'partials/',
						'main.blade.php'	=> 'partials/sections/',
						'index.blade.php'	=> 'views/',
						'style.css'			=> 'assets/css/',
						'script.js'			=> 'assets/js/',
						'theme.json'		=> '',
						'gulpfile.js'		=> '',
						'config.php'		=> ''
						]);

		$this->info('Theme "'.$this->getTheme().'" has been created.');
	}
582614
public function handle()
    {
        $app = app();
        $this->version = (int) str_replace('.', '', $app->version());

        // check if module exists
        if ($this->files->exists(app_path().'/Modules/'.studly_case($this->getNameInput()))) {
            return $this->error($this->type.' already exists!');
        }

        // Create Controller
        $this->generate('controller');

        // Create Model
        $this->generate('model');

        // Create Views folder
        $this->generate('view');

        //Flag for no translation
        if (! $this->option('no-translation')) { // Create Translations folder
            $this->generate('translation');
        }

        if ($this->version < 530) {

            // Create Routes file
            $this->generate('routes');
        } else {

            // Create WEB Routes file
            $this->generate('web');
            
            // Create API Routes file
            $this->generate('api');
        }
        
        // Create Helper file
        $this->generate('helper');



        if (! $this->option('no-migration')) {

            // without hacky studly_case function
            // foo-bar results in foo-bar and not in foo_bar
            $table = str_plural(snake_case(studly_case($this->getNameInput())));
            $this->call('make:migration', ['name' => "create_{$table}_table", '--create' => $table]);
        }

        $this->info($this->type.' created successfully.');
    }
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')]
        );
    }
878337
public function handle()
    {

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


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

        if ( $this->removeViewFiles($path) ) {

            $this->sendViewSuccessMessage();


        } else {

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

        }

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

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

        $this->setPaths();

        if ( $this->deleteCrudFiles() ) {

            $this->sendSuccessMessage();

            return;

        }

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




    }