Execute the console command.
@author Sang Nguyen
180000
public function handle()
    {
        $pattern = storage_path('logs') .DS .'*.log';

        $files = $this->files->glob($pattern);

        foreach ($files as $file) {
            $this->files->delete($file);
        }

        $this->info('Log files cleared successfully!');
    }
1002965
public function handle()
    {
        if (file_exists(base_path() . '/vendor/compiled.php') ||
            file_exists(base_path() . '/bootstrap/cache/compiled.php') ||
            file_exists(base_path() . '/storage/framework/compiled.php')) {
            $this->error(
                'Error generating IDE Helper: first delete your compiled file (php artisan clear-compiled)'
            );
        } else {
            $filename = $this->argument('filename');
            $format = $this->option('format');

            // Strip the php extension
            if (substr($filename, -4, 4) == '.php') {
                $filename = substr($filename, 0, -4);
            }

            $filename .= '.' . $format;

            if ($this->option('memory')) {
                $this->useMemoryDriver();
            }


            $helpers = '';
            if ($this->option('helpers') || ($this->config->get('ide-helper.include_helpers'))) {
                foreach ($this->config->get('ide-helper.helper_files', array()) as $helper) {
                    if (file_exists($helper)) {
                        $helpers .= str_replace(array('<?php', '?>'), '', $this->files->get($helper));
                    }
                }
            } else {
                $helpers = '';
            }

            $generator = new Generator($this->config, $this->view, $this->getOutput(), $helpers);
            $content = $generator->generate($format);
            $written = $this->files->put($filename, $content);

            if ($written !== false) {
                $this->info("A new helper file was written to $filename");

                if ($this->option('write_mixins')) {
                    Eloquent::writeEloquentModelHelper($this, $this->files);
                }
            } else {
                $this->error("The helper file could not be created at $filename");
            }
        }
    }
909400
public function handle()
    {
        $arguments = $this->getArgumentsWithDriver('name');
        $driver = $arguments['driver'];
        $name = $arguments['name'];

        // It's possible for the developer to specify the tables to modify in this
        // schema operation. The developer may also specify if this table needs
        // to be freshly created so we can create the appropriate migrations.
        $create = $this->input->getOption('create');
        $table = $this->input->getOption('table');

        if (! $table && \is_string($create)) {
            $table = $create;
        }

        // Now we are ready to write the migration out to disk. Once we've written
        // the migration out, we will dump-autoload for the entire framework to
        // make sure that the migrations are registered by the class loaders.
        $this->writeMigration($driver, $name, $table, $create);

        $this->composer->dumpAutoloads();
    }
850670
public function handle()
    {
        $package = $this->input->getArgument('package');

        // Direct specification of the package and Views path.
        if (! is_null($path = $this->getPath())) {
            $this->publisher->publish($package, $path);
        }

        // For the packages which are registered as plugins.
        else if ($this->plugins->exists($package)) {
            if (Str::length($package) > 3) {
                $slug = Str::snake($package);
            } else {
                $slug = Str::lower($package);
            }

            $properties = $this->plugins->where('slug', $slug);

            //
            $package = $properties['name'];

            if ($properties['type'] == 'package') {
                $path = $properties['path'] .str_replace('/', DS, '/src/Views');
            } else {
                $path = $properties['path'] .DS . 'Views';
            }

            $this->publisher->publish($package, $path);
        }

        // For other packages located in vendor.
        else {
            $this->publisher->publishPackage($package);
        }

        $this->output->writeln('<info>Views published for package:</info> '.$package);
    }
1239852
public function handle()
    {
        $themeNamespace = $this->argument('namespace');
        $themeNamespace = strtolower($themeNamespace);

        $this->themeNamespace = $themeNamespace;

        $name = $this->ask('Template name');
        $author = $this->ask('Template author');

        $this->makeThemeFolder();
        $this->makeThemeConfig($name, $author);

        $this->info('Theme created succesfully!');
    }
613910
public function handle()
    {
        if (! $this->hasValidNameArgument()) {
            return;
        }

        (new Filesystem)->copyDirectory(
            __DIR__.'/../../stubs/asset-stubs',
            $this->assetPath()
        );

        // AssetServiceProvider.php replacements...
        $this->replace('{{ namespace }}', $this->assetNamespace(), $this->assetPath().'/src/AssetServiceProvider.stub');
        $this->replace('{{ component }}', $this->assetName(), $this->assetPath().'/src/AssetServiceProvider.stub');
        $this->replace('{{ name }}', $this->assetName(), $this->assetPath().'/src/AssetServiceProvider.stub');

        // Asset composer.json replacements...
        $this->replace('{{ name }}', $this->argument('name'), $this->assetPath().'/composer.json');
        $this->replace('{{ escapedNamespace }}', $this->escapedAssetNamespace(), $this->assetPath().'/composer.json');

        // Rename the stubs with the proper file extensions...
        $this->renameStubs();

        // Register the asset...
        $this->addAssetRepositoryToRootComposer();
        $this->addAssetPackageToRootComposer();
        $this->addScriptsToNpmPackage();

        if ($this->confirm("Would you like to install the asset's NPM dependencies?", true)) {
            $this->installNpmDependencies();

            $this->output->newLine();
        }

        if ($this->confirm("Would you like to compile the asset's assets?", true)) {
            $this->compile();

            $this->output->newLine();
        }

        if ($this->confirm('Would you like to update your Composer packages?', true)) {
            $this->composerUpdate();
        }
    }
61388
public function handle()
    {
        $files = new Filesystem;

        $files->deleteDirectory(app_path('Http/Controllers/Auth'));

        $files->delete(base_path('database/migrations/2014_10_12_000000_create_users_table.php'));
        $files->delete(base_path('database/migrations/2014_10_12_100000_create_password_resets_table.php'));

        $this->info('Original Auth removed! Enjoy your fresh start.');
    }
274449
public function handle()
    {
        if (! $this->confirmToProceed()) {
            return;
        }

        $driver = $this->getDriver();
        $database = $this->option('database');
        $id = $this->option('id');
        $pretend = $this->option('pretend', false);

        $this->prepareDatabase($driver, $database, $id);

        $migrator = $this->tenant->driver($driver);

        $this->setupMigrationOutput($migrator);

        $migrator->run($database, $id, $pretend);
    }
685981
public function handle()
    {
        if ($module = $this->argument('module')) {
            $this->publishConfiguration($module);

            return;
        }

        foreach ($this->laravel['modules']->allEnabled() as $module) {
            $this->publishConfiguration($module->getName());
        }
    }
727043
public function handle()
    {
        $this->call('laralum:info');

        $this->info('Looking for installed packages...');

        $packages = Packages::all();

        $this->call('laralum:packages');

        $this->line(' ');
        $this->comment('- Found '.count($packages).' packages installed');

        if ($this->confirm('Do you wish to continue?')) {
            $this->info('Publishing packages...');
            $this->line(' ');

            $bar = $this->output->createProgressBar(count($packages));

            foreach ($packages as $package) {
                $provider = Packages::provider($package);
                if ($provider) {
                    if (class_exists('Laralum\\'.ucfirst($package)."\\$provider")) {
                        $pr = 'Laralum\\'.ucfirst($package)."\\$provider";
                    } elseif (class_exists('Laralum\\'.strtoupper($package)."\\$provider")) {
                        $pr = 'Laralum\\'.strtoupper($package)."\\$provider";
                    }

                    if ($pr) {
                        $this->callSilent('vendor:publish', [
                            '--provider' => $pr,
                        ]);
                    }
                }
                $bar->advance();
            }
            $bar->finish();
            $this->line(' ');
            $this->line(' ');
            $this->info('All the packages were published!');
        } else {
            $this->error('Publishing stopped');
        }
    }
1096452
public function handle()
    {
        $name = $this->argument('name');

        $fileSystem = new Filesystem();

        $files = $fileSystem->allFiles(__DIR__.'/../PublishedAssets/Theme');
        $this->line("\n");
        foreach ($files as $file) {
            $this->line(str_replace(__DIR__.'/../PublishedAssets/Theme/', '', str_replace('themeTemplate', strtolower($name), $file)));
        }

        $this->info("\n\nThese files will be generated\n");

        $result = $this->confirm('Are you sure you want to generate this theme?');

        if ($result) {
            foreach ($files as $file) {
                $newFileName = str_replace(__DIR__.'/../PublishedAssets/Theme', '', $file);
                $newFileName = str_replace('themeTemplate', strtolower($name), $newFileName);
                $this->line('Copying '.$newFileName.'...');
                if (is_dir($file)) {
                    $fileSystem->copyDirectory($file, base_path($newFileName));
                } else {
                    @mkdir(base_path(str_replace(basename($newFileName), '', $newFileName)), 0755, true);
                    $fileSystem->copy($file, base_path($newFileName));
                }
            }

            $sass = file_get_contents(base_path('resources/themes/'.strtolower($name).'/assets/sass/_theme.scss'));
            $sassRepairs = str_replace('themeTemplate', strtolower($name), $sass);
            file_put_contents(base_path('resources/themes/'.strtolower($name).'/assets/sass/_theme.scss'), $sassRepairs);

            $layout = file_get_contents(base_path('resources/themes/'.strtolower($name).'/layout/master.blade.php'));
            $layoutRepairs = str_replace('themeTemplate', strtolower($name), $layout);
            file_put_contents(base_path('resources/themes/'.strtolower($name).'/layout/master.blade.php'), $layoutRepairs);

            $this->info('Finished generating your theme');
            $this->line("\n");
            $this->info('Please add this to your gulpfile.js in the scripts elixir:');
            $this->comment('../../themes/'.strtolower($name).'/assets/js/theme.js');
            $this->line("\n");
            $this->info('Please add this to your app.scss:');
            $this->comment('@import "resources/themes/'.strtolower($name).'/assets/sass/_theme.scss"');
        } else {
            $this->info('Nothing has been changed or added');
        }
    }
388486
public function handle()
    {
        $file = $this->getFileName();
        $path = $this->getPath();
        $filePath = $this->getFilePath();
        $eol = PHP_EOL;

        $this->generator->makeGitIgnore($file, $path);

        if (file_exists($this->getFilePath())) {
            $this->error(PHP_EOL . 'Wordpress is already down.' . PHP_EOL);
        } else {
            $this->generator->makeMaintenanceFile($filePath);
            $this->info("{$eol}Wordpress set to maintenance mode. Either run \"artisan wp:up\" to {$eol} bring the site back up or manually delete {$eol} {$filePath}.");
        }
    }
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]);
        }
    }
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));
    }
691814
public function handle()
    {
        // Ensure there are no caches
        $this->callSilent('cache:clear');

        // Install plugin from a zip source
        if(substr($this->argument('source'), -3) === 'zip') {
            $this
                ->getZip()
                ->extractZip()
                ->readConfigFile()
                ->copySourceContent();
        }
        // clone from git
        elseif(strstr($this->argument('source'), 'git')) {
            $this->cloneFromGit()->readConfigFile()->copySourceContent();
        }else{
            $this->pluginNamespace = $this->argument('source');
        }

        // Validate and install
        if ($this->canInstall()) {
            $this->info("Installing...");
            if ($this->pluginInstance->install($this)) {
                if ($this->addPluginInDB()) {
                    $this->cleanTmp();

                    $this->line('');
                    $this->block('Plugin installed successfully', 'fg=black;bg=green');
                    $this->line('');
                    $this->comment('Next step: Execute "npm run watch" to compile view files');
                    $this->line('');
                }
            }
        }
    }
595105
public function handle()
    {
        $packageName = $this->argument('name');

        if (!$this->templateStorageEngine->packageExists($packageName)) {
            $this->comment("The package {$packageName} is not currently installed.");

            return;
        }

        $this->line("Removing {$packageName}. Sit back and relax for a minute, this can take a while.");
        $this->templateStorageEngine->removePackage($packageName);
        $this->info("{$packageName} removed.");
    }
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());
    }