To handle console command
6761
public function handle()
    {
        $isSuccess = $this->filesystem->cleanDirectory($this->app->sessionDirectoryPath());

        if($isSuccess) {
            $this->info('Session cleared!');
        }
    }
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;
        }
    }
1008835
public function handle()
    {
        if (is_null($this->argument('name'))) {
            $this->installFromFile();

            return;
        }

        $this->install(
            $this->argument('name'),
            $this->argument('version'),
            $this->option('type'),
            $this->option('tree')
        );
    }
870934
public function handle(): void
    {
        $directory = $this->argument('directory');

        if (!is_dir($directory)) {
            $this->error(
                sprintf('The directory "%1$s" does not exist. Run `resume make --output=%1$s`.', $directory)
            );

            exit(1);
        }

        chdir($directory);

        $this->info(
            sprintf('Resume preview started: http://%s:%s', $this->host(), $this->port())
        );
        $this->info('Stop the server with CTRL+C.');

        passthru($this->command($this->host(), $this->port()), $exitCode);

        exit($exitCode);
    }
435026
public function handle()
    {
        if ($this->checkIfCanIncrement('current')) {
            $number = app('pragmarx.version')->incrementMajor();

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

            $this->displayAppVersion();
        }
    }
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;
    }
732619
public function handle()
    {
        $cmd = collect(array_merge($this->getSeleniumDefaultCommand(), $this->getArguments()))
            ->except('driver', 'serverVersion')
            ->implode(' ');

        $this->info('Starting Selenium server v'.$this->argument('serverVersion'));
        $this->info("Using {$this->argument('driver')} driver");

        echo shell_exec($cmd.' '.$this->getSeleniumOptions());
    }
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();
    }
1012821
public function handle()
    {
        $deploymentsPath = $this->option('path');
        if(!$deploymentsPath) {
            $deploymentsPath = base_path($this->deploymentsPath);
        }

        // Drop tables
        if($this->option('drop')) {
            $tables = DB::select('SHOW TABLES');
            if($tables) {
                $this->comment("\nDropping current tables");
                $this->dropAllTables();
                $this->info("Current tables dropped");
            }else{
                $this->comment("No tables to drop!");
            }
        }

        // Import sql files
        if(File::isDirectory($deploymentsPath)) {
            $sqlFiles = File::files($deploymentsPath);
            if ($sqlFiles) {
                $this->comment("\nImporting deployment SQL files");
                foreach ($sqlFiles as $file) {
                    if ($file->getExtension() == "sql") {
                        $command = 'mysql -h ' . env('DB_HOST') . ' -u ' . env('DB_USERNAME') . ' -p' . env('DB_PASSWORD') . ' ' . env('DB_DATABASE') . ' < ' . $file->getPathName();

                        $this->process->setCommandLine($command);
                        $this->process->setTimeout(null);
                        $this->process->run();

                        if (!$this->process->isSuccessful()) {
                            $this->error("Database '" . $file->getPathName() . "' not deployed!");
                            break;
                        }else{
                            // Delete file
                            File::delete($file->getPathName());
                        }
                    }
                }
                $this->info("Deployment SQL files imported!");
            }
        }
    }
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);
    }
1207885
public function handle()
    {
        $this->line('Processing...');

        //get command arguments
        $message = $this->argument('message');
        $to      = $this->argument('to');
        $attach  = $this->argument('attach');

        //init client
        $this->initClient();

        //attach data
        $this->addAttachment($attach);

        //add to
        $this->addTo($to);

        //send
        $this->send($message);

        $this->info('Message sent');
    }
85806
public function handle()
    {
        \chdir(\base_path('public'));

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

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

        $base = $this->laravel->basePath();

        $this->info("Lumen development server started on http://{$host}:{$port}/");

        \passthru('"'.PHP_BINARY.'"'." -S {$host}:{$port} \"{$base}\"/lumen/server.php");
    }
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();
    }
1172386
public function fire()
    {
        $generator = new ConsoleGenerator([
            'name' => $this->argument('name'),
            'force' => $this->option('force'),
            'command' => $this->option('command'),
            'description' => $this->option('description'),
        ]);

        $generator->run();

        $this->info('Console created successfully.');
    }
763839
public function handle()
    {
        $this->processInput();
        $tmpfile = $this->createTmpFileWithMenu();
        $path = $this->getPath($tmpfile);
        add_file_into_file($this->mountpoint(), $path, $dstFile = $this->destinationFile());
        $this->info('Menu ' . $this->name() . ' added to ' .  $dstFile . '.');
        $this->postActions();
    }
627085
public function handle()
    {
        $this->line(static::$logo);
        $this->line(Admin::getLongVersion());

        $this->comment('');
        $this->comment('Available commands:');

        $this->listAdminCommands();
    }
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.');
        }
    }