To handle console command
180813
public function handle()
    {
        $eventName  = $this->input->getArgument('name');

        $eventNamespace = $this->getNamespace('Events', $eventName);

        $eventStubs = $this->filesystem->get(__DIR__.'/../stubs/MakeEvent.txt');

        $eventStubs = str_replace([ 'dummyEventName', 'dummyNamespace', '\\\\' ], [ basename($eventName), $eventNamespace, '\\' ], $eventStubs);

        if(!file_exists($filename = app_path() ."/Events/{$eventName}.php")) {
            $this->filesystem->create($filename, $eventStubs);
            $this->info("{$eventName} has been created successfully.");
        } else {
            $this->info("{$eventName} already exists.");
        }
    }
1177259
public function perform()
    {
        $app = $this->application();

        $command = $this->getConsoleCommand($app);

        $inputDefinition = $this->getInputDefinition($this->args);

        // Create Input object with $this->args loaded as Input arguments
        $input  = new ArrayInput($this->args, $inputDefinition);
        $output = new ConsoleOutput;

        // Output error details to the console if available
        try {
            $command->run($input, $output);
        } catch (\Exception $e) {
            $output->writeln('Exception: '.$e->getMessage());
            $output->writeln('Code: '.$e->getCode());
            $output->writeln('Stack trace: '.$e->getTraceAsString());

            throw $e;
        }
    }
1011926
public function handle()
    {
        $disk = $this->argument('disk');
        $directory = $this->option('directory') ?: '';
        $non_recursive = (bool) $this->option('non-recursive');
        $force = (bool) $this->option('force');

        $this->call('media:prune', [
            'disk' => $disk,
            '--directory' => $directory,
            '--non-recursive' => $non_recursive,
        ]);

        $this->call('media:import', [
            'disk' => $disk,
            '--directory' => $directory,
            '--non-recursive' => $non_recursive,
            '--force' => $force,
        ]);
    }
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!');


    }
61356
public function handle()
    {
        $this->line('=== Rename public directory to "public_html" ===');

        if (! \File::exists(base_path('public_html/index.php'))) {
            \File::copyDirectory(base_path('public'), base_path('public_html'));
            \File::deleteDirectory(base_path('public'));
            $dir = str_replace('/Commands', '', __DIR__);
            \File::copy($dir.'/../configVendor/larrock-index-public_html_php', base_path('public_html/index.php'));
            $this->info('Directory and index.php successfully updated');
        } else {
            $this->info('The command is not required, the directory has already changed.');
        }
    }
435026
public function handle()
    {
        if ($this->checkIfCanIncrement('current')) {
            $number = app('pragmarx.version')->incrementMajor();

            $this->info("New major version: {$number}");

            $this->displayAppVersion();
        }
    }
355924
public function handle()
    {
        // Write in environment file.
        $path = base_path('.env');
        $env = file($path);

        // Detect existing configuration.
        if ($this->hasExistingConfiguration($env)) {

            if ($this->option('preserve')) {
                return;
            }

            if (! $this->option('overwrite')) {
                if (! $this->confirm("Overwrite existing configuration?")) {
                    return;
                }
            }

            $this->removeExistingConfiguration($env);
        }

        $this->writeNewConfiguration($env, $path);
        $this->info("FakeId configured correctly.");
    }
60101
public function handle()
    {
        $exportPath = $this->option('path');

        if($exportPath) {
            if(!file_exists($exportPath)) {
                throw new \Exception('Path '.$exportPath. ' does not exists!');
            }
        }else{
            $exportPath = storage_path('app/dumper');

            // create dumper directory
            if(!file_exists($exportPath)) {
                File::makeDirectory($exportPath, 0755);
            }
        }

        $filePath = $exportPath.'/'.date("Ymdhisi").'.sql';
      
        $this->comment("Starting database dump...");

        switch (config('database.default')){
        case 'mysql':
            MySql::create()
                ->setDbName(config('database.connections.mysql.database'))
                ->setHost(config('database.connections.mysql.host'))
                ->setUserName(config('database.connections.mysql.username'))
                ->setPassword(config('database.connections.mysql.password'))
                ->dumpToFile($filePath);
            break;

        case 'pgsql':
            PostgreSql::create()
                ->setDbName(config('database.connections.pgsql.database'))
                ->setUserName(config('database.connections.pgsql.username'))
                ->setPassword(config('database.connections.pgsql.password'))
                ->dumpToFile($filePath);
            break;

        case 'sqlite':
            Sqlite::create()
                ->setDbName(config('database.connections.sqlite.database'))
                ->dumpToFile($filePath);
            break;

        case 'mongodb':
            MongoDb::create()
                ->setDbName(config('database.connections.mongodb.database'))
                ->setUserName(config('database.connections.mongodb.username'))
                ->setPassword(config('database.connections.mongodb.password'))
                ->dumpToFile($filePath);
            break;
        }

        $this->info("Database successfully dumped to ".$filePath);
    }
588206
public function handle()
    {
        $slug = $this->argument('slug');

        if (modules($this->option('location'))->isDisabled($slug)) {
            modules($this->option('location'))->enable($slug);

            $module = modules($this->option('location'))->where('slug', $slug);

            event($slug.'.module.enabled', [$module, null]);

            $this->info('Module was enabled successfully.');
        } else {
            $this->comment('Module is already enabled.');
        }
    }
1681
public function handle()
    {
        $events = $this->schedule->dueEvents($this->container);

        foreach ($events as $event) {
            $this->line('<info>Running scheduled command:</info> ' .$event->getSummaryForDisplay());

            $event->run($this->container);
        }

        if (count($events) === 0) {
            $this->info('No scheduled commands are ready to run.');
        }
    }
1058699
public function handle()
    {
        $extension = $this->argument('extension');

        if (empty($extension) || !Arr::has(Admin::$extensions, $extension)) {
            $extension = $this->choice('Please choose a extension to import', array_keys(Admin::$extensions));
        }

        $className = Arr::get(Admin::$extensions, $extension);

        if (!class_exists($className) || !method_exists($className, 'import')) {
            $this->error("Invalid Extension [$className]");

            return;
        }

        call_user_func([$className, 'import'], $this);

        $this->info("Extension [$className] imported");
    }
656622
public function handle()
    {
        foreach ($this->schedule->dueEvents($this->laravel) as $event) {
            if (! $event->filtersPass($this->laravel)) {
                continue;
            }

            if ($event->onOneServer) {
                $this->runSingleServerEvent($event);
            } else {
                $this->runEvent($event);
            }

            $this->eventsRan = true;
        }

        if (! $this->eventsRan) {
            $this->info('No scheduled commands are ready to run.');
        }
    }
253795
public function handle() {
        // Create a new command instance
        $newCreateCommand = new CreateBaseCommand;


        // get the field list array
        $field_list = $this->getFieldList();


        // add the field_list itself to new command instance
        $newCreateCommand->field_list = $field_list;

        // add crud_action to the new command instance
        $newCreateCommand->crud_action = Input::get('crud_action');

        // add fields with their associated data to the new command instance
        foreach( $field_list as $field )
        {
            if ( $field['name'] == "id" ) continue;

            if ( ($field['name'] == "featured_image_upload") && (Input::file($field['name'])) ) {
                $newCreateCommand->{$field['name']} = Input::file($field['name'])->getClientOriginalName();
            } else {
                $newCreateCommand->{$field['name']} = Input::get($field['name']);
            }
        }

        // Get the namespace and class name of the Form Processor class
        $namespace_formprocessor        = $this->getNamespaceFormprocessor();
        $classname_formprocessor_create = $this->getClassnameFormprocessorCreate();

        // Inject a new instance of the container, in order to inject the relevant model.
        $this->app   = new Container;

        // bind the Form Processor class to the IoC (that is, inject the Form Processor class into the IoC)
        $this->$classname_formprocessor_create = $this->app->make( $namespace_formprocessor."\\".$classname_formprocessor_create );

        // Now onto the Form Processor, aka "The Command Handler"
        return $this->$classname_formprocessor_create->quarterback($newCreateCommand);
    }
1011598
public function handle()
    {

        $command = $this->argument('function') ? $this->argument('function') : 'create';
        $param = $this->argument('params') ? $this->argument('params') : '';
        if (is_callable([$this, $command])) {
            $this->$command($param);
        } else {
            $this->error(sprintf('%s command not found', $command));
        }
    }
796164
public function handle()
    {
    	# Collecting data and initialization
		$alias 		= $this->argument('name');
		$mMode 		= $this->option('m');
		$profileName= $this->option('profile');
		$profile	= ConfigurationManager::Get("profiles.{$profileName}");
		$publisher	= new FilePublisher($profileName, $alias);
		$manipulator= new Manipulator($profileName, $alias);
		# Checking for alias duplicated
		if($mMode == false){
			if(\file_exists(Utility::getAliasPath($alias))){
				switch (ConfigurationManager::Get("profiles.{$profileName}.publishMode")) {
					case 'clean':
						$this->line('Alias directory already exist! Cleaning old directory...');
						Utility::deleteFiles(Utility::getAliasPath($alias));
						break;
					case 'nothing':
						$this->error('Alias directory already exist! publish failed! Please check publishMode configuration for change publish mode.');
						return;
				}
			}	
			# publishing application
			$this->line('Preparing...');
			$publisher->prepare();
			$this->info("copying {$publisher->getFileCount()} files...");
			$progress = $this->output->createProgressBar($publisher->getFileCount());
			$progress->setFormat("%message%<bg=black>(<fg=white>%current%</> OF <fg=yellow>%max%</>)</> <bg=red;fg=white>%percent% %</>");
			$progress->setMessage('Copying Files: ');
			$publisher->startPublish(function() use ($progress){
				$progress->advance();
			},function() use ($progress){
				$progress->finish();
			});
			$this->line('');
			$this->info('done!');
		}
		$this->line('Manipulating codes...');
		$manipulator->startManipulation();
		$this->info('done!');

		$this->line('<bg=white;fg=blue>Your application ready for publish on web server. enjoy it!</>');
    }
1159702
public function handle()
    {
        // Next, we will check to see if a path option has been defined. If it has
        // we will use the path relative to the root of this installation folder
        // so that migrations may be run for any path within the applications.
        $this->migrator->run($this->getMigrationPaths(), []);

        // Once the migrator has run we will grab the note output and send it out to
        // the console screen, since the migrator itself functions without having
        // any instances of the OutputInterface contract passed into the class.
        foreach ($this->migrator->getNotes() as $note) {
            $this->output->writeln($note);
        }
    }
563054
public function handle()
    {
        // Next, we will check to see if a path option has been defined. If it has
        // we will use the path relative to the root of this installation folder
        // so that migrations may be run for any path within the applications.
        $this->deployer->run($this->getDeployPaths(), []);

        // Once the migrator has run we will grab the note output and send it out to
        // the console screen, since the migrator itself functions without having
        // any instances of the OutputInterface contract passed into the class.
        foreach ($this->deployer->getNotes() as $note) {
            $this->output->writeln($note);
        }
    }