Execute the console command.

@param \Oxygen\Core\Blueprint\BlueprintManager $blueprints
@return mixed
@throws \Exception
505367
public function handle(BlueprintManager $blueprints) {
        $blueprint = $blueprints->get($this->argument('name'));

        $this->heading('General Information');

        $this->table($this->generalHeaders, [$this->getGeneralInformation($blueprint)]);

        $this->heading('Toolbars');

        foreach($blueprint->getToolbarOrders() as $name => $contents) {
            $this->output->writeln($name . ': ' . Formatter::keyedArray($contents));
        }

        $this->heading('Actions');

        $actions = [];
        foreach($blueprint->getActions() as $action) {
            $actions[] = $this->getActionInformation($action);
        }
        $this->table($this->actionHeaders, $actions);
    }
368309
public function blueprint(Blueprint $blueprint) {
        foreach($blueprint->getActions() as $action) {
            $this->action($action);
        }
    }
396305
public function handle()
    {
        $this->compile = $this->option( 'compile' );
        $this->contract = app( RegisterBlueprint::class );
        $region = $this->askWhichRegionElementIsFor();
        $layoutClassName = $this->askWhichLayoutToCreate();

        try {
            $region = self::getClassDetails( $region );
        } catch( \Exception $e ) {
            $this->error( "{$region->fileName} does not exist" );
            exit;
        }

        if( ! method_exists( $layoutClassName, 'generate' ) ) {
            $this->error( "Layout {$layoutClassName} does not provide generation support, exiting..." );
            exit;
        }

        $layoutClassName::generate( $region, $this );

        if( $this->compile ) {
            $this->info( exec( "php artisan laraview:compile" ) );
        }
    }
1137991
public function handle()
    {
        $this->info('Hello! Together we are going to config Acacha Laravel Forge publish ...');

        if (! ForgePublishRCFile::exists()) {
            $this->call('publish:rc');
        };

        $this->confirmAnUserIsCreatedInAcachaLaravelForge();

        $this->call('publish:url');

        $this->call('publish:email');

        $this->login();

        $this->call('publish:check_token');

        $this->call('publish:server');

        $this->call('publish:domain');

        $this->call('publish:project_type');

        $this->call('publish:site_directory');

        $this->call('publish:site');

        $this->call('publish:github');

        $this->finish();
    }
1368446
public function handle()
    {
        $input = $this->getCommandInput();

        if ($this->isRouteNameExists($this->getDotNotationName($this->getModelName($input->modelName), $input->prefix, 'index'))) {
            $this->warn("The routes already registered!");
            return;
        }

        $routesFile = $this->getRoutesFileName();

        if (!$this->isFileExists($routesFile)) {
            throw new Exception("The routes file does not exists. The expected location was " . $routesFile);
        }

        $stub = $this->getStubContent('routes');

        $controllnerName = $this->getControllerName($input->controllerName, $input->controllerDirectory);

        $this->replaceModelName($stub, $input->modelName)
            ->replaceControllerName($stub, $controllnerName)
            ->replaceRouteNames($stub, $this->getModelName($input->modelName), $input->prefix)
            ->processRoutesGroup($stub, $input->prefix, $input->controllerDirectory)
            ->appendToRoutesFile($stub, $routesFile)
            ->info('The routes were added successfully.');
    }
364221
public function handle(): void
    {
        collect(Artisan::all())->filter(function ($command) {
            return mb_strpos($command->getName(), 'cortex:rollback:') !== false;
        })->partition(function ($command) {
            return in_array($command->getName(), ['cortex:rollback:foundation', 'cortex:rollback:auth']);
        })->flatten()->each->run(new ArrayInput(['--force' => $this->option('force')]), $this->output);
    }
438450
public function fire()
	{
		if (! $this->migrator->repositoryExists()) {
			return $this->error('No migrations found.');
		}

		$this->migrator->setConnection($this->input->getOption('database'));

		if (! is_null($path = $this->input->getOption('path'))) {
			$path = $this->laravel->basePath().'/'.$path;
		} else {
			$path = $this->getMigrationPath();
		}

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

		$migrations = [];

		foreach ($this->getAllMigrationFiles($path) as $migration) {
			$migrations[] = in_array($migration, $ran) ? ['<info>Y</info>', $migration] : ['<fg=red>N</fg=red>', $migration];
		}

		if (count($migrations) > 0) {
			$this->table(['Ran?', 'Migration'], $migrations);
		} else {
			$this->error('No migrations found');
		}
	}
1213733
public function handle()
    {
        $basePath = $this->getMigrationPath();
        $migrations = $this->migrator->getMigrationFiles($basePath, false);
        $count = count($migrations);

        if ($count == 0) {
            $this->comment('No migrations to move');

            return;
        }

        foreach ($migrations as $migration_name => $migration_path) {
            $datePath = $this->migrator->getDateFolderStructure($migration_name);

            // Create folder if it does not already exist
            if (! $this->files->exists($basePath.'/'.$datePath)) {
                $this->files->makeDirectory($basePath.'/'.$datePath, 0775, true);
            }

            // Move the migration into its new folder
            $this->files->move($basePath.'/'.$migration_name.'.php', $basePath.'/'.$datePath.$migration_name.'.php');
        }

        $this->info('Migrations organised successfully ('.$count.' migrations moved)');
    }
522742
public function fire()
    {
        $this->comment('Regeneration of assets collections...');
        $directories = $this->getDirectories();
        if (empty($directories)) {
            $this->comment('no directories to scan, abort');

            return;
        }

        //dd($directories);
        $scanner = $this->getScanner();

        $scanner->setDirectoriesToScan($directories);

        $scanner->scan();
        $added = $scanner->getNewlyBuildedCollections();
        $removed = $scanner->getRemovedBuildedCollections();
        if (count($added) > 0) {
            $this->comment('added collections : '.implode(', ', $added));
        }
        if (count($removed) > 0) {
            $this->comment('removed collections : '.implode(', ', $removed));
        }
        if ((count($added) + count($removed)) > 0 && $this->option('silent') !== true) {
            $update = $this->ask('Update Assets groups with the new or removed collections ? y/n', 'y');
            $this->comment('sorry in the new release ;)');
        }
        $this->comment('done');
    }
236846
public function handle()
    {
        $this->basePath = $this->getMigrationPath();
        $migrations = $this->migrator->getMigrationFiles($this->basePath);
        $count = count($migrations);

        if ($count == 0) {
            $this->comment('No migrations to move');

            return;
        }

        foreach ($migrations as $migration_name => $migration_path) {
            $datePath = $this->migrator->getDateFolderStructure($migration_name);
            // Move the migration into base migration folder
            $this->files->move($this->basePath.'/'.$datePath.$migration_name.'.php', $this->basePath.'/'.$migration_name.'.php');
        }

        $this->info('Migrations disorganised successfully ('.$count.' migrations moved)');
        $this->cleanup();
    }
459051
public function handle()
    {
        if (! $model = $this->getModel()) {
            return;
        }

        $configurator = $model->getIndexConfigurator();

        $mapping = array_merge_recursive(
            $configurator->getDefaultMapping(),
            $model->getMapping()
        );

        if (empty($mapping)) {
            throw new LogicException('Nothing to update: the mapping is not specified.');
        }

        $payload = new TypePayload($model);

        if (in_array(Migratable::class, class_uses_recursive($configurator))) {
            $payload->useAlias('write');
        }

        $payload->set('body.'.$model->searchableAs(), $mapping);

        ElasticClient::indices()
            ->putMapping($payload->get());

        $this->info(sprintf(
            'The %s mapping was updated!',
            $model->searchableAs()
        ));
    }
1355930
public function fire()
	{
		$this->call('route:clear');

		$routes = $this->getFreshApplicationRoutes();

		if (count($routes) == 0)
		{
			return $this->error("Your application doesn't have any routes.");
		}

		foreach ($routes as $route)
		{
			$route->prepareForSerialization();
		}

		$this->files->put(
			$this->laravel->getCachedRoutesPath(), $this->buildRouteCacheFile($routes)
		);

		$this->info('Routes cached successfully!');
	}
396990
public function handle ()
    {
        $configurationPath = __DIR__ . '/templates/config/package.json';
        if (!file_exists ($configurationPath))
            $this->abort ('Missing package configuration file');

        $json = json_decode (file_get_contents ($configurationPath), true);

        $this->createDirectory ('packages');

        $directoryList = [];

        foreach (File::directories ('packages') as $directory)
        {
            $vendorPackages = File::directories ($directory);

            foreach ($vendorPackages as $vendorPackage)
                if (!file_exists($vendorPackage . '/src/app/honeycomb/config.json'))
                    array_push($directoryList, $vendorPackage);
        }

        if($directoryList == null)
            $this->abort('You must create your package directory first');
        
        $packageDirectory = $this->choice ('Please select package directory', $directoryList);
        $packageOfficialName = str_replace ('packages/', '', $packageDirectory);
        $nameSpace = $this->stringOnly (str_replace ('/', '\\', $packageOfficialName));
        $composerNameSpace = str_replace (['\\', '/'], '\\\\', $packageOfficialName . '\\');
        $composerNameSpace = str_replace ('-', '', $composerNameSpace);

        $packageName = $this->ask ('Please enter package name');

        foreach ($json['create_folders'] as $location) {
            $this->info ('Creating folder: ' . $packageDirectory . '/' . $location);
            $this->createDirectory ($packageDirectory . '/' . $location);
        }

        $this->createFileFromTemplate ([
            "destination"         => $packageDirectory . '/src/app/http/helpers.php',
            "templateDestination" => __DIR__ . '/templates/shared/empty.hctpl',
        ]);

        $this->createFileFromTemplate ([
            "destination"         => $packageDirectory . '/src/app/honeycomb/routes.php',
            "templateDestination" => __DIR__ . '/templates/shared/empty.hctpl',
        ]);

        $this->createFileFromTemplate ([
            "destination"         => $packageDirectory . '/src/.gitignore',
            "templateDestination" => __DIR__ . '/templates/package/gitignore.hctpl',
        ]);

        $this->createFileFromTemplate ([
            "destination"         => $packageDirectory . '/src/app/honeycomb/config.json',
            "templateDestination" => __DIR__ . '/templates/shared/hc.config.hctpl',
            "content"             => [
                "serviceProviderNameSpace" => $packageName
            ]
        ]);

        $this->createFileFromTemplate ([
            "destination"         => $packageDirectory . '/composer.json',
            "templateDestination" => __DIR__ . '/templates/package/composer.hctpl',
            "content"             => [
                "packageOfficialName" => $packageOfficialName,
                "packagePath"         => $composerNameSpace,
            ],
        ]);

        $this->createFileFromTemplate ([
            "destination"         => $packageDirectory . '/src/app/providers/' . $packageName . 'ServiceProvider.php',
            "templateDestination" => __DIR__ . '/templates/package/service.provider.hctpl',
            "content"             => [
                "packageName"              => $packageName . 'ServiceProvider',
                "nameSpace"                => $nameSpace . '\app\providers',
                "nameSpaceGeneral"         => $nameSpace . '\app\http\controllers',
                "serviceProviderNameSpace" => $packageName,
            ],
        ]);

        $this->createFileFromTemplate ([
            "destination"         => $packageDirectory . '/src/database/seeds/HoneyCombDatabaseSeeder.php',
            "templateDestination" => __DIR__ . '/templates/package/database.seeder.hctpl',
            "content"             => [
                "nameSpace" => $nameSpace,
                "className" => "HoneyComb"
            ],
        ]);

        $this->comment ('');
        $this->comment ('********************************************************');

        if (App::environment () == 'local') {
            $composer = json_decode (file_get_contents ('composer.json'));

            if (!isset($composer->autoload->{'psr-4'}->{$composerNameSpace}))
                $composer->autoload->{'psr-4'}->{str_replace ('\\\\', '\\', $composerNameSpace)} = $packageDirectory . '/src';

            file_put_contents ('composer.json', json_encode ($composer, JSON_PRETTY_PRINT));
        }

        $this->comment ('Please add to config/app.php under "providers":');
        $this->info ($nameSpace . '\app\providers\\' . $packageName . 'ServiceProvider::class');

        $this->comment ('********************************************************');


    }
727564
public function fire()
    {
        $asset = \App::make('asset');

        // we need to turn on concatenation
        // since we are spitting out assets

        $config = $asset->getConfig();
        $config['environment'] = $this->option('env') ? : 'production';
        $asset->setConfig($config);

        $generator = new StaticFilesGenerator($asset->getGenerator());

        $generated = $generator->generate(public_path($config['routing']['prefix']));

        foreach ($generated as $file) {
            $this->line($file);
        }

        $this->line('<info>codesleeve\asset-pipeline assets generated! :)</info>');
    }
347835
public function handle()
    {

        $actions   = array_keys(app('config')->get('antares/logger::analyzer.actions'));
        $contents  = [];
        $processor = app('Antares\Logger\Processor\AnalyzeProcessor');

        foreach ($actions as $action) {
            try {
                array_push($contents, $processor->{$action}()->render());
            } catch (Exception $ex) {
                Log::emergency($ex);
                continue;
            }
        }


        $html     = implode('', $contents);
        $rendered = view('antares/logger::admin.generator.preview', ['html' => $html])->render();
        $filename = str_random() . '.html';
        $path     = storage_path("temp/{$filename}");
        file_put_contents($path, $rendered);
        $this->line($path);
    }
651993
public function fire()
    {
        // Scaffolding should always begin with the singular
        // form of the now.
        $this->model = Pluralizer::singular($this->argument('name'));

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

        if (is_null($this->fields))
        {
            throw new MissingFieldsException('You must specify the fields option.');
        }

        // We're going to need access to these values
        // within future commands. I'll save them
        // to temporary files to allow for that.
        $this->cache->fields($this->fields);
        $this->cache->modelName($this->model);

        $this->generateModel();
        $this->generateController();
        $this->generateViews();
        $this->generateMigration();
        $this->generateSeed();

        if (get_called_class() === 'Fly\\Generators\\Commands\\ScaffoldGeneratorCommand')
        {
            $this->generateTest();
        }

        if ($this->generator->updateRoutesFile($this->model))
        {
            $this->info('Updated ' . app_path() . '/routes.php');
        }
        else
        {
            $this->comment('Did not need to update ' . app_path() . '/routes.php');
        }

        // We're all finished, so we
        // can delete the cache.
        $this->cache->destroyAll();
    }
845721
public function fire()
    {
        $this->generators = new Collection();

        $this->generators->push(new MigrationGenerator([
            'name'   => 'create_' . snake_case(str_plural($this->argument('name'))) . '_table',
            'fields' => $this->option('fillable'),
            'force'  => $this->option('force'),
        ]));

        $modelGenerator = new ModelGenerator([
            'name'     => $this->argument('name'),
            'fillable' => $this->option('fillable'),
            'force'    => $this->option('force')
        ]);

        $this->generators->push($modelGenerator);

        $this->generators->push(new RepositoryInterfaceGenerator([
            'name'  => $this->argument('name'),
            'force' => $this->option('force'),
        ]));

        foreach ($this->generators as $generator) {
            $generator->run();
        }

        $model = $modelGenerator->getRootNamespace() . '\\' . $modelGenerator->getName();
        $model = str_replace([
            "\\",
            '/'
        ], '\\', $model);

        try {
            (new RepositoryEloquentGenerator([
                'name'      => $this->argument('name'),
                'rules'     => $this->option('rules'),
                'validator' => $this->option('validator'),
                'presenter' => $this->option('presenter'),
                'force'     => $this->option('force'),
                'model'     => $model
            ]))->run();
            $this->info("Repository created successfully.");
        } catch (FileAlreadyExistsException $e) {
            $this->error($this->type . ' already exists!');

            return false;
        }
    }