Execute the console command.

@return mixed
7062
public function handle()
    {
        // Are we being asked to remove the scaffolding?
        $removal = $this->option('remove');

        // Determine the package file path
        $centaurFilename = with(new ReflectionClass('Centaur\CentaurServiceProvider'))->getFileName();
        $centaurPath = dirname($centaurFilename);

        // Get the current application namespace
        $this->namespace = str_replace('\\', '', $this->getAppNamespace());

        // Check our destination directories
        if (!$removal) {
            if (!is_dir(app_path('Http/Controllers/Auth')) && $removal == false) {
                $this->files->makeDirectory(app_path('Http/Controllers/Auth'));
            }

            if (!is_dir(base_path('resources/views/centaur'))) {
                $this->files->makeDirectory(base_path('resources/views/centaur'));
            }

            if (!is_dir(base_path('resources/views/centaur/auth'))) {
                $this->files->makeDirectory(base_path('resources/views/centaur/auth'));
            }

            if (!is_dir(base_path('resources/views/centaur/email'))) {
                $this->files->makeDirectory(base_path('resources/views/centaur/email'));
            }

            if (!is_dir(base_path('resources/views/centaur/roles'))) {
                $this->files->makeDirectory(base_path('resources/views/centaur/roles'));
            }

            if (!is_dir(base_path('resources/views/centaur/users'))) {
                $this->files->makeDirectory(base_path('resources/views/centaur/users'));
            }
        }

        // Namespaced Files
        $namespaced = [
            '/Controllers/Auth/PasswordController.php' => base_path('app/Http/Controllers/Auth/PasswordController.php'),
            '/Controllers/Auth/RegistrationController.php' => base_path('app/Http/Controllers/Auth/RegistrationController.php'),
            '/Controllers/Auth/SessionController.php' => base_path('app/Http/Controllers/Auth/SessionController.php'),
            '/Controllers/RoleController.php' => base_path('app/Http/Controllers/RoleController.php'),
            '/Controllers/UserController.php' => base_path('app/Http/Controllers/UserController.php'),
        ];

        // Copy Namespaced files
        foreach ($namespaced as $file  => $destination) {
            if ($this->files->exists($destination)) {
                if ($removal) {
                    $this->files->delete($destination);
                    $this->info('Removed File: ' . $destination);
                } else {
                    $this->info('File Already Exists: ' . $destination);
                }
            } else {
                if (!$removal) {
                    $this->files->copy($centaurPath . $file, $destination);
                    $this->updateNamespace($destination);
                    $this->info($destination);
                }
            }
        }

        // Non-namespaced files
        $assets = [
            '/../views/auth/login.blade.php' => base_path('resources/views/centaur/auth/login.blade.php'),
            '/../views/auth/password.blade.php' => base_path('resources/views/centaur/auth/password.blade.php'),
            '/../views/auth/register.blade.php' => base_path('resources/views/centaur/auth/register.blade.php'),
            '/../views/auth/resend.blade.php' => base_path('resources/views/centaur/auth/resend.blade.php'),
            '/../views/auth/reset.blade.php' => base_path('resources/views/centaur/auth/reset.blade.php'),
            '/../views/email/reset.blade.php' => base_path('resources/views/centaur/email/reset.blade.php'),
            '/../views/email/welcome.blade.php' => base_path('resources/views/centaur/email/welcome.blade.php'),
            '/../views/roles/create.blade.php' => base_path('resources/views/centaur/roles/create.blade.php'),
            '/../views/roles/edit.blade.php' => base_path('resources/views/centaur/roles/edit.blade.php'),
            '/../views/roles/index.blade.php' => base_path('resources/views/centaur/roles/index.blade.php'),
            '/../views/users/create.blade.php' => base_path('resources/views/centaur/users/create.blade.php'),
            '/../views/users/edit.blade.php' => base_path('resources/views/centaur/users/edit.blade.php'),
            '/../views/users/index.blade.php' => base_path('resources/views/centaur/users/index.blade.php'),
            '/../views/dashboard.blade.php' => base_path('resources/views/centaur/dashboard.blade.php'),
            '/../views/layout.blade.php' => base_path('resources/views/centaur/layout.blade.php'),
            '/../views/notifications.blade.php' => base_path('resources/views/centaur/notifications.blade.php'),
            '/../public/restfulizer.js' => base_path('public/restfulizer.js'),
            '/../seeds/SentinelDatabaseSeeder.php' => base_path('database/seeds/SentinelDatabaseSeeder.php'),
        ];

        // Copy Non-namespaced files
        foreach ($assets as $file  => $destination) {
            if ($this->files->exists($destination)) {
                if ($removal) {
                    $this->files->delete($destination);
                    $this->info('Removed File: ' . $destination);
                } else {
                    $this->info('File Already Exists: ' . $destination);
                }
            } else {
                if (!$removal) {
                    $this->files->copy($centaurPath . $file, $destination);
                    $this->info($destination);
                }
            }
        }
    }
1362326
public function handle()
    {
        $this->info('Generating optimized class loader');

        $this->laravel->configure('optimizer');

        $this->composer->dumpAutoloads('--no-dev --optimize');

        if ($this->option('force') || !env('APP_DEBUG')) {
            $this->info('Compiling common classes');

            $this->compileClasses();
        } else {
            $this->call('clear-compiled');
        }
    }
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);
    }
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;
    }
1231285
public function handle()
	{
		$lemma   = $this->argument( 'lemma' );
		$folders = $this->manager->getPath( $this->folders );

		//////////////////////////////////////////////////
		// Display where translatations are searched in //
		//////////////////////////////////////////////////
		if ( $this->option( 'verbose' ) )
		{
			$this->writeLine( "Lemmas will be searched in the following directories:" );

			foreach ( $folders as $path )
			{
				$this->writeLine( '    <info>' . $path . '</info>' );
			}

			$this->writeLine( '' );
		}

		////////////////////////////////
		// Parse all lemmas from code //
		////////////////////////////////
		$files = $this->manager->findLemma( $lemma , $folders , $this->trans_methods , $this->option( 'regex' ) , $this->option( 'short' ) );

		if ( ( is_array( $files ) ) && ( count( $files ) > 0 ) )
		{
			$this->writeLine( 'Lemma <info>' . $lemma . '</info> has been found in:' );
			foreach ( $files as $file )
			{
				$this->writeLine( '    <info>' . $file . '</info>' );
			}

			return self::SUCCESS;
		}
		else
		{
			return self::ERROR;
		}
	}
1354288
public function handle()
    {
        $group = $this->input->getArgument('group');

        if (is_null($group)) {
            return $this->publish();
        }

        $groups = explode(',', $group);

        foreach($groups as $group) {
            $this->publish($group);
        }
    }
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());
        }
    }
719297
public function handle()
    {
        $class = config(
            'auth.providers.' . config(
                'auth.guards.' . config(
                    'auth.defaults.guard'
                ) . '.provider'
            ) . '.model'
        );
        $user = new $class;
        $fillables = $user->getFillable();
        foreach($fillables as $key => $fillable) {
            if ($fillable == 'password') {
                $user->password = \Hash::make($this->secret(($key+1) . "/" . count($fillables) . " User $fillable"));
            } else {
                $user->$fillable = $this->ask(($key+1) . "/" . count($fillables) . " User $fillable");
            }
        }
        if ($this->confirm("Do you want to create the user?", true)) {
            $user->save();
            $this->info("User created (id: {$user->id})");
        }

        return true;
    }
487870
public function handle()
    {
        $arguments = $this->argument();
        $option = $this->option();
        $options = [];

        array_walk($option, function (&$value, $key) use (&$options) {
            $options['--' . $key] = $value;
        });

        unset($arguments['slug']);
        unset($options['--location']);

        $modulePath = module_path($this->argument('slug'), 'Database/Migrations', $this->option('location'));
        $options['--path'] = str_replace(realpath(base_path()), '', realpath($modulePath));
        $options['--path'] = ltrim($options['--path'], '/');

        return $this->call('make:migration', array_merge($arguments, $options));
    }
576974
public function handle()
    {
        // Retrieve attributes
        $attributes = config('commands.user_attributes');

        // Retrieve sensitive fields
        $sensitive_attributes = config('commands.user_attributes_sensitive');

        // Ask questions and prepare data
        foreach ($attributes as $attribute => $question) {
            if (is_null($attribute) || $attribute === 0) {
                $attribute = $question;
            }

            // Check if sensitive field
            if (in_array($attribute, $sensitive_attributes)) {
                $attributes[$attribute] = Hash::make($this->secret($question));
                continue;
            }

            $attributes[$attribute] = $this->ask($question);
        }

        // Create new user
        try {
            $user = App::make(config('commands.user'));
            $user::create($attributes);
            $this->info('User created');
        } catch (\Exception $exception) {
            $this->error($exception->getMessage());
        }
    }
1133668
public function handle()
    {
        $exists = false;

        if (File::exists($this->publishedMigrationRealpath())) {
            $exists = true;

            if (!$this->confirm('The migration file already exists, overwrite it? [Yes|no]')) {
                return $this->info('Okay, no changes made to the file.');
            }
        }

        $inputFile = file_get_contents($this->localMigrationRealpath());

        $outputFile = fopen($this->publishedMigrationRealpath(), 'w');

        if ($inputFile && $outputFile) {
            fwrite($outputFile, $inputFile);

            fclose($outputFile);
        } else {
            File::delete($this->publishedMigrationRealpath());

            return $this->error(
                        'There was an error creating the migration file, '
                        .'check write permissions for ' . base_path('database') . DIRECTORY_SEPARATOR . 'migrations'
                        .PHP_EOL
                        .PHP_EOL
                        .'If you think this is a bug, please submit a bug report '
                        .'at https://github.com/moharrum/laravel-geoip-world-cities/issues'
                    );
        }

        if(! $exists) {
            $this->info('Okay, migration file created successfully.');

            return;
        }

        $this->info('Okay, migration file overwritten successfully.');
    }
190397
public function handle()
    {
        $this->info(sprintf('%s (v%s)', config('setup.title'), self::VERSION));

        $pretend = (bool) $this->option('pretend');
        $steps   = (array) $this->argument('step');
        $return  = $this->runSteps($steps, $pretend);

        $this->info('Setup finished.');

        return $return;
    }
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));
	}
146494
public function handle()
    {
        $disk = $this->argument('disk');
        $directory = $this->option('directory') ?: '';
        $recursive = ! $this->option('non-recursive');
        $counter = 0;

        $records = Media::inDirectory($disk, $directory, $recursive)->get();

        foreach ($records as $media) {
            if (! $media->fileExists()) {
                $media->delete();
                ++$counter;
                $this->info("Pruned record for file {$media->getDiskPath()}", 'v');
            }
        }

        $this->info("Pruned {$counter} record(s).");
    }
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);
    }
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');
    }
100217
public function handle()
    {
        // setup
        $this->setSettings();
        $this->getResourceName($this->getUrl(false));

        // check the path where to create and save file
        $path = $this->getPath('');
        if ($this->files->exists($path) && $this->optionForce() === false) {
            return $this->error($this->type . ' already exists!');
        }

        // make all the directories
        $this->makeDirectory($path);

        // build file and save it at location
        $this->files->put($path, $this->buildClass($this->argumentName()));

        // output to console
        $this->info(ucfirst($this->option('type')) . ' created successfully.');
        $this->info('- ' . $path);

        // if we need to run "composer dump-autoload"
        if ($this->settings['dump_autoload'] === true) {
            if ($this->confirm("Run 'composer dump-autoload'?")) {
                $this->composer->dumpAutoloads();
            }
        }
    }