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

        $listenerNamespace = $this->getNamespace('Listeners', $listenerName);

        if(!is_null($eventName)) {
            $eventName = str_replace('/','\\', $eventName);
            $eventNamespace = $this->app->getNamespace(). "Events\\{$eventName}";
            $listenerStubs = $this->filesystem->get(__DIR__.'/../stubs/MakeListenerEvent.txt');
            $listenerStubs = str_replace([ 'dummyListenerName', 'dummyEventNameVariable', 'dummyEventName', 'dummyNamespace', 'dummyUse', '\\\\' ],
                                     [ basename($listenerName), lcfirst(basename($eventName)), basename($eventName), $listenerNamespace, $eventNamespace, '\\' ], $listenerStubs);
        } else {
            $listenerStubs = $this->filesystem->get(__DIR__.'/../stubs/MakeListener.txt');
            $listenerStubs = str_replace([ 'dummyListenerName', 'dummyNamespace', '\\\\' ],
                [ basename($listenerName), $listenerNamespace, '\\' ], $listenerStubs);
        }


        if(!file_exists($filename = app_path() ."/Listeners/{$listenerName}.php")) {
            $this->filesystem->create($filename, $listenerStubs);
            $this->info("{$listenerName} has been created successfully.");
        } else {
            $this->info("{$listenerName} already exists.");
        }
    }
1015680
public function handle()
    {
        $this->checkPhpVersion();

        chdir($this->container['path.base']);

        $host = $this->input->getOption('host');

        $port = $this->input->getOption('port');

        $public = $this->container['path.public'];

        $this->info("Nova Framework development Server started on http://{$host}:{$port}");

        passthru('"'.PHP_BINARY.'"'." -S {$host}:{$port} -t \"{$public}\" server.php");
    }
123367
public function handle()
    {
        if ($this->checkIfCanIncrement('current')) {
            $number = app('pragmarx.version')->incrementMinor();

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

            $this->displayAppVersion();
        }
    }
648787
public function handle()
    {
        $commands = config('deploy.commands.purge_old_releases.after');
        foreach($commands as $command){
            $output = $this->scriptParser->parseString(
                $command, [
                'base_path' => base_path(),
                'env' => $this->option('env')
                ]
            )->run($this);

            if(!$output) {
                return false;
            }
        }
    }
843993
def handle(self):
        
        self.output = PyStratumStyle(self.input, self.output)

        config_file = self.argument('config_file')
        sources = self.argument('file_names')

        status = self.run_command(config_file, sources)

        return status
630812
public function handle()
    {
        try {
            $role = App::make(config('commands.role'));

            $role::create([
                'name' => $this->ask('Name?')
            ]);
            $this->info('Role created');
        } catch (\Exception $exception) {
            $this->error($exception->getMessage());
        }
    }
470604
public function handle()
    {
        $options = $this->options();
        foreach (['host', 'port', 'username', 'secret'] as $key) {
            $value = Arr::get($options, $key, null);
            $value = is_null($value) ? Arr::get($this->config, $key, null) : $value;
            $options[$key] = $value;
        }
        $client = $this->connector->create($options);
        $client->then([$this, 'client'], [$this, 'writeException']);
        $this->loop->run();
    }
1351478
public function handle($command)
    {
        $this->commandStack[] = $command;

        if ($this->executing) {
            return;
        }

        $first = true;

        while ($command = array_shift($this->commandStack)) {
            $this->invokeHandler($command, $first);
            $first = false;
        }
    }
477902
public function handle()
	{
		$namespace = $this->argument('namespace');

		$templateHelper = new TemplatesHelper();
		$templateData = $templateHelper->getTemplate('AppBaseController', 'Controller');

		$templateData = str_replace('$$BASE_NAMESPACE$$', $namespace, $templateData);

		$fileName = "AppBaseController.php";

		$filePath = __DIR__ . "/../../Controller/";

		$fileHelper = new FileHelper();
		$fileHelper->writeFile($filePath . $fileName, $templateData);
		$this->comment('AppBaseController generated');
		$this->info($fileName);
	}
1078387
public function handle()
    {
        try {
            $data = $this->argument('data');
            if (filter_var($data, FILTER_VALIDATE_URL)) {
                // need to download file
                $data = FileUtilities::importUrlFileToTemp($data);
            }

            if (is_file($data)) {
                $data = file_get_contents($data);
            }

            $format = $this->option('format');
            $format = DataFormats::toNumeric($format);
            $this->comment($format);

            $service = $this->option('service');
            $resource = $this->option('resource');
            $result = ServiceManager::handleRequest($service, Verbs::POST, $resource, [], [], $data, $format, false);
            if ($result->getStatusCode() >= 300) {
                $this->error(print_r($result->getContent(), true));
            } else {
                $this->info('Import complete!');
            }
        } catch (\Exception $e) {
            $this->error($e->getMessage());
        }
    }
913089
public function handle()
    {
        $tableName = $this->argument('table');
        $filePath  = $this->argument('file_path');

        $includeId = $this->option('include_id');

        $columnNames = [];

        $columnInformation = \DB::select('show columns from '.$tableName);
        if (!empty($this->option('columns'))) {
            $columnNames = explode(',', $this->option('columns'));
        } else {
            if ($includeId) {
                $columnNames[] = 'id';
            }
            foreach ($columnInformation as $entity) {
                if ($entity->Field !== 'id') {
                    $columnNames[] = $entity->Field;
                }
            }
        }
        $defaultValues = [];
        foreach ($columnInformation as $entity) {
            if ($entity->null === 'NO') {
                $type = $entity->Type;
                if (Str::startsWith($type, 'varchar') || Str::startsWith($type, 'char') || Str::startsWith($type, 'text')) {
                    $defaultValues[$entity->Field] = '';
                } else {
                    $defaultValues[$entity->Field] = 0;
                }
            }
        }

        $excel = app()->make(Excel::class);
        $excel->filter('chunk')->load($filePath)->chunk(250, function($results) use ($tableName, $columnNames, $defaultValues) {
            foreach ($results as $row) {
                $data = [];
                foreach ($columnNames as $columnName) {
                    if ($row->has($columnName) && !empty($row->get($columnName))) {
                        $data[$columnName] = $row->get($columnName);
                    } elseif (array_key_exists($columnName, $defaultValues)) {
                        $data[$columnName] = $defaultValues[$columnName];
                    }
                }
                \DB::table($tableName)->insert($data);
            }
        });

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


    }
737945
public function handle()
    {

        // Ask what command
        $command = $this->choice('What command are you running?', $this->availableCommands->toArray());

        if (!$this->availableCommands->has($command)) {
            $this->info('The specified command does not exist.');
            return;
        }

        $method = 'make' . ucfirst($command);
        call_user_func([$this, $method]);

        $this->call('make:'. $command, $this->options);
    }
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.");
    }
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");
    }
1234430
public function handle()
    {
        $this->writeln();
        $this->writeln('Example help screen');
        $this->writeln();
        $this->writeln('Usage: helloworld [OPTIONS]');
        $this->writeln('A Hello World application to demonstrate Clip');
        $this->writeln();
        $this->writeln('Commands:');
        $this->writeln('  help       - This information screen');
        $this->writeln('  test       - A silly test example');
        $this->writeln('  flags      - Example using options.');
        $this->writeln('  profile    - Example of required --name and --age options.');
        $this->writeln('  check:name - User input example');

        $this->writeln();
        $this->exitWithSuccess();
    }
188868
public function handle()
    {
        if ($this->checkIfCanIncrement('current')) {
            $number = app('pragmarx.version')->incrementPatch();

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

            $this->displayAppVersion();
        }
    }