Execute the console command.

@return mixed
18422
public function handle()
    {
        $name = $this->argument('name');
        if (str_contains($name, '\\')) {
            $location = $this->filesystem->transformNamespaceToLocation($name);
            $filename = $this->filesystem->getFileName($name);

        }else {
            $location = 'app/Repositories';
            $filename = $name;
        }
        $model = strpos($filename, 'Repository') ? explode('Repository', $filename)[0] : $filename;

        if (file_exists($location . '/' . $filename . '.php')) {
            return $this->error('Repository already exists');
        }
        $this->filesystem->makeDirectory(base_path($location), 0755, true, true);

        if (config('artify.adr.enabled') && !is_dir(app_path('App/Domain/Contracts'))) {
            $contractLocation = app_path('App/Domain/Contracts/');
            $repositoryLocation = app_path('App/Domain/Repositories/');
            $this->filesystem->makeDirectory($contractLocation, 0755, true, true);
            $this->filesystem->makeDirectory($repositoryLocation, 0755, true, true);
            
        }
        if (!config('artify.adr.enabled') && !is_dir(app_path('Repositories/Contracts'))) {
            $contractLocation = app_path('Repositories/Contracts/');
            $repositoryLocation = app_path('Repositories/');
            $this->filesystem->makeDirectory($contractLocation, 0755, true, true);
        }
        if (isset($contractLocation) && !$this->filesystem->exists($contractLocation . 'RepositoryInterface.php')) {
            copy(artify_path('artifies/stubs/RepositoryInterface.stub'),  $contractLocation . 'RepositoryInterface.php');
        }

        if (isset($repositoryLocation) && !$this->filesystem->exists($repositoryLocation . 'Repository.php')) {
            copy(artify_path('artifies/stubs/Repository.stub'), $repositoryLocation . 'Repository.php');
        }
        $namespacedModel = config('artify.adr.enabled') ? $this->filesystem->getNamespaceFromLocation(substr($location, 0, strrpos($location, '/'))) . '\\Models\\' . $model : config('artify.models.namespace') . $model;
        if ($this->option('model')) {
            if (config('artify.adr.enabled')) {
                $this->call('make:model',[
                    'name' => $namespacedModel
                ]);
            }
        }
        if (config('artify.adr.enabled')) {
            $namespacedModel = $namespacedModel . ";\nuse App\\Domain\\Repositories\\Repository";
        }
        $defaultRepositoryContent = $this->filesystem->get(artify_path('artifies/stubs/DummyRepository.stub'));
        $runtimeRepositoryContent = str_replace(['DummyNamespace','DummyModelNamespace', 'DummyRepository', 'Dummy'], [ $this->filesystem->getNamespaceFromLocation($location), $namespacedModel, $filename , ucfirst($model)], $defaultRepositoryContent);
        $this->filesystem->put(artify_path('artifies/stubs/DummyRepository.stub'), $runtimeRepositoryContent);
        $this->filesystem->copy(artify_path('artifies/stubs/DummyRepository.stub'), $location . '/' . $filename . '.php');
        $this->filesystem->put(artify_path('artifies/stubs/DummyRepository.stub'), $defaultRepositoryContent);

        $this->info('Yeey! Repository created successfully');
    }
781304
public function handle()
    {
        $this->migrator->setConnection($this->option('database'));

        if (!$this->migrator->repositoryExists()) {
            return $this->error('No migrations found.');
        }

        $ran = $this->migrator->getRepository()->getRan();

        if (count($migrations = $this->getStatusFor($ran)) > 0) {
            $this->table(['Ran?', 'Migration'], $migrations);
        } else {
            $this->error('No migrations found');
        }
    }
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.");
    }
219386
public function handle()
    {
        $package = $this->input->getArgument('package');

        $proceed = $this->confirmToProceed('Config Already Published!', function () use ($package) {
            return $this->config->alreadyPublished($package);
        });

        if (! $proceed) {
            return;
        }

        if (! is_null($path = $this->getPath())) {
            $this->config->publish($package, $path);
        } else {
            $this->config->publishPackage($package);
        }

        $this->output->writeln('<info>Configuration published for package:</info> '.$package);
    }
1019657
public function handle()
    {
        if (!file_exists(base_path('.env'))) {
            $this->error('File .env not found');
            return false;
        }
        if (config('app.key') == '') {
            $this->info('Key Generate...');
            $this->call('key:generate');
        }
        if (!is_link(public_path('storage'))) {
            $this->info('Storage Link...');
            $this->call('storage:link');
        }
        if (!file_exists(app_path('Http/Controllers/HomeController.php')) && $this->confirm('Do you want to run make:auth?')) {
            $this->info('Make Auth...');
            $this->call('make:auth');
        }
        $this->info('Migrate and Seeding...');
        if ($this->option('migrate-fresh')) {
            $this->call('migrate:fresh', [ '--seed' => true ]);
        } elseif ($this->option('migrate-refresh')) {
            $this->call('migrate:refresh', [ '--seed' => true ]);
        } else {
            $this->call('migrate', [ '--seed' => true ]);
        }
        if (!file_exists(storage_path('oauth-private.key')) || !file_exists(storage_path('oauth-public.key'))) {
            $this->info('Passport Key Generate...');
            $this->call('passport:install');
        }

        return true;
    }
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')]
        );
    }
1188441
public function handle()
    {
        $id = $this->argument('id');

        if ($id === null) {
            $this->table(
                ['ID', 'Email'],
                User::all(['id', 'email'])->toArray()
            );
            $id = $this->ask('ID?');
        }

        User::where('id', $id)->update([
            'password' => bcrypt($this->secret('New password?'))
        ]);

        $this->info('User was updated');
    }
1011421
public function handle()
    {
        $this->meta = (new NameParser)->parse($this->argumentName());

        $name = $this->qualifyClass($this->getNameInput());
        $path = $this->getPath($name);

        if ($this->files->exists($path) && $this->optionForce() === false) {
            return $this->error($this->type . ' already exists!');
        }

        $this->makeDirectory($path);
        $this->files->put($path, $this->buildClass($name));

        $this->info($this->type . ' created successfully.');
        $this->info('- ' . $path);

        // if model is required
        if ($this->optionModel() === true || $this->optionModel() === 'true') {
            $this->call('generate:model', [
                'name'     => $this->getModelName(),
                '--plain'  => $this->optionPlain(),
                '--force'  => $this->optionForce(),
                '--schema' => $this->optionSchema()
            ]);
        }
    }
1286894
public function handle()
    {
        if (! $this->confirmToProceed()) {
            return;
        }

        $slug = $this->argument('slug');

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

            if ($this->packages->isEnabled($slug)) {
                $this->seed($slug);
            } else if ($this->option('force')) {
                $this->seed($slug);
            }

            return;
        }

        if ($this->option('force')) {
            $packages = $this->packages->all();
        } else {
            $packages = $this->packages->enabled();
        }

        foreach ($packages as $package) {
            $slug = $package['slug'];

            $this->seed($slug);
        }
    }
635532
public function handle()
	{
		$theme = strtolower($this->argument('name'));
		$new_theme = strtolower($this->argument('new-name'));

		$theme_path = $this->getPath($theme);
		$new_theme_path = $this->getPath($new_theme);

		if(!$this->files->isDirectory($theme_path)){
			return $this->error('Theme "'.$theme.'" does not exist.');
		}

		if($this->files->isDirectory($new_theme_path)){
			return $this->error('Theme "'.$new_theme.'" is already exists.');
		}

		$this->files->copyDirectory($theme_path, $new_theme_path);

		$this->info('Theme "'.$new_theme.'" has been created.');
	}
275098
public function handle()
    {
        $clear = $this->clearTransients();
        if($clear !== 0) {
            $this->error(Helpers::getLang(get_class($this), 'error', ['count' => $clear]));
            return;
        }
        $this->info(Helpers::getLang(get_class($this), 'success', []));
        return;
    }
967136
public function handle()
    {
        if (! $this->confirmToProceed()) {
            return;
        }

        $slug = $this->argument('slug');

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

        $this->call('package:migrate:reset', array(
            'slug'       => $slug,
            '--database' => $this->option('database'),
            '--force'    => $this->option('force'),
            '--pretend'  => $this->option('pretend'),
        ));

        $this->call('package:migrate', array(
            'slug'       => $slug,
            '--database' => $this->option('database'),
        ));

        if ($this->needsSeeding()) {
            $this->runSeeder($slug, $this->option('database'));
        }

        $this->info('Package has been refreshed.');
    }
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;
    }
191560
public function handle()
    {
        // Get Settings
        $defaultCurrency = $this->currency->config('default');

        if ($this->input->getOption('google')) {
            // Get rates from google
            return $this->updateFromGoogle($defaultCurrency);
        }

        if ($this->input->getOption('openexchangerates')) {
            if (!$api = $this->currency->config('api_key')) {
                $this->error('An API key is needed from OpenExchangeRates.org to continue.');

                return;
            }

            // Get rates from OpenExchangeRates
            return $this->updateFromOpenExchangeRates($defaultCurrency, $api);
        }
    }
1290667
public function handle()
    {
        try {
            $this->filesystem->overwrite(
                $path = database_path('seeds/' . config('AdminUserSeeder', 'AdminUserSeeder.php')),
                $this->compiler->compile(
                    $this->filesystem->get($this->getStubPath()),
                    [
                        "USER_NAME" => $this->username(),
                        "USER_EMAIL" => $this->email(),
                    ]
                )
            );
            $this->info('File ' . $path . ' created');
        } catch (\Exception $e) {
            print_r($e->getMessage());
        }
    }
608587
public function handle()
    {

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

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

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

        $this->setCrudPaths();

        if ( $this->deleteFiles() ) {

            $this->sendSuccessMessage();

            return;

        }

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


    }
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');
        }
    }