To handle console command
510167
public function handle()
    {
        $oldNamespace = rtrim($this->app->getNamespace(),'\\');
        $newNamespace = ucfirst($this->input->getArgument('name'));

        $this->setAppNamespace($oldNamespace, $newNamespace);

        $this->setBootstrapNamespace($oldNamespace, $newNamespace);

        $this->setConfigNamespace($oldNamespace, $newNamespace);

        $this->setComposerNamespace($oldNamespace, $newNamespace);

        $this->composerDumpAutoload();
    }
696729
public function handle()
    {
        $theme = strtolower($this->argument('name'));

        $this->installTheme($theme);
        $this->setupTheme($theme);

        if ($this->option('default')) {
            $this->setAsDefaultTheme($theme);
        }

        $this->info('Theme ['.$theme.'] installed.');
    }
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.');
        }
    }
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();
    }
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.");
    }
973517
def handle(self):
        
        self.output = PyStratumStyle(self.input, self.output)

        config_file = self.input.get_argument('config_file')
        self.run_command(config_file)
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);
    }
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);
    }
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;
        }
    }
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);
    }
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;
    }
1274894
public function handle()
    {
        $this->abortCommandExecution();
        $file = $this->argument('file');
        $this->runScp(base_path($file), $this->domain, null, true);
    }
96014
public function handle()
    {
        if (! is_dir(base_path('tests/Browser/Pages'))) {
            mkdir(base_path('tests/Browser/Pages'), 0755, true);
        }

        if (! is_dir(base_path('tests/Browser/Components'))) {
            mkdir(base_path('tests/Browser/Components'), 0755, true);
        }

        if (! is_dir(base_path('tests/Browser/screenshots'))) {
            $this->createScreenshotsDirectory();
        }

        if (! is_dir(base_path('tests/Browser/console'))) {
            $this->createConsoleDirectory();
        }

        $stubs = [
            'ExampleTest.stub' => base_path('tests/Browser/ExampleTest.php'),
            'HomePage.stub' => base_path('tests/Browser/Pages/HomePage.php'),
            'DuskTestCase.stub' => base_path('tests/DuskTestCase.php'),
            'Page.stub' => base_path('tests/Browser/Pages/Page.php'),
        ];

        foreach ($stubs as $stub => $file) {
            if (! is_file($file)) {
                copy(__DIR__.'/../../stubs/'.$stub, $file);
            }
        }

        $this->info('Dusk scaffolding installed successfully.');

        $this->comment('Downloading ChromeDriver binaries...');

        $this->call('dusk:chrome-driver', ['--all' => true]);
    }
953774
public function handle()
    {
        $folders         = $this->manager->getPath($this->folders);
        $this->display   = ! $this->option('silent');
        $extension       = $this->option('php-file-extension');
        $obsolete_prefix = (empty($this->obsolete_array_key)) ? '' : $this->obsolete_array_key.'.';

        //////////////////////////////////////////////////
        // Display where translations are searched in //
        //////////////////////////////////////////////////
        if ($this->option('verbose')) {
            $this->writeLine("Lemmas will be searched in the following directories:");

            foreach ($folders as $path) {
                $this->writeLine('    <info>'.$path.'</info>');
            }

            $this->writeLine('');
        }

        ////////////////////////////////
        // Parse all lemmas from code //
        ////////////////////////////////
        $lemmas = $this->manager->extractTranslationsFromFolders($folders, $this->trans_methods, $extension);

        if (count($lemmas) === 0) {
            $this->writeComment("No lemma has been found in code.");
            $this->writeLine("I have searched recursively in PHP files in these directories:");

            foreach ($this->manager->getPath($this->folders) as $path) {
                $this->writeLine("    ".$path);
            }

            $this->writeLine("for these functions/methods:");

            foreach ($this->trans_methods as $k => $v) {
                $this->writeLine("    ".$k);
            }

            return self::SUCCESS;
        }

        $this->writeLine((count($lemmas) > 1) ? count($lemmas)." lemmas have been found in code" : "1 lemma has been found in code");

        if ($this->option('verbose')) {
            foreach ($lemmas as $key => $value) {
                if (strpos($key, '.') !== false) {
                    $this->writeLine('    <info>'.$key.'</info> in file <comment>'.$this->manager->getShortPath($value).'</comment>');
                }
            }
        }

        /////////////////////////////////////////////
        // Convert dot lemmas to structured lemmas //
        /////////////////////////////////////////////
        if ($this->option('output-flat')) {
            $lemmas_structured = $this->manager->convertLemmaToFlatArray($lemmas);
        } else {
            $lemmas_structured = $this->manager->convertLemmaToStructuredArray($lemmas, $this->dot_notation_split_regex, null);
        }

        $this->writeLine('');

        /////////////////////////////////////
        // Generate lang files :           //
        // - add missing lemmas on top     //
        // - keep already defined lemmas   //
        // - add obsolete lemmas on bottom //
        /////////////////////////////////////
        try {
            $dir_lang = $this->manager->getLangPath($this->lang_folder_path);
        } catch (Exception $e) {
            switch ($e->getCode()) {
                //@codeCoverageIgnoreStart
                case Localization::NO_LANG_FOLDER_FOUND_IN_THESE_PATHS:
                    $this->writeError("No lang folder found in these paths:");
                    foreach ($e->getParameter() as $path) {
                        $this->writeError("- ".$path);
                    }
                    break;
                //@codeCoverageIgnoreEnd

                case Localization::NO_LANG_FOLDER_FOUND_IN_YOUR_CUSTOM_PATH:
                    $this->writeError('No lang folder found in your custom path: "'.$e->getParameter().'"');
                    break;
            }

            $this->writeLine('');

            return self::ERROR;
        }

        $job           = [];
        $there_are_new = false;

        $this->writeLine('Scan files:');

        /**
         * Parse all lang file types
         *
         * @var LangFileAbstract $langFileType
         */
        foreach (LangFile::getLangFiles($dir_lang, $this->json_languages) as $langFileType) {
            if ($langFileType->getTypeVendor()) {
                continue;
            }

            $lang = $langFileType->getLang();

            /**
             * Parse now all extracted families
             */
            foreach ($lemmas_structured as $family => $array) {
                if ($family === Localization::JSON_HEADER) {
                    $lang_file = new LangFileJson($dir_lang, $lang);
                } else {
                    $lang_file = new LangFileGenuine($dir_lang, $lang, $family);

                    if (in_array($family, $this->ignore_lang_files) || in_array($lang_file->getShortFilePath(), $this->ignore_lang_files)) {
                        if ($this->option('verbose')) {
                            $this->writeLine('');
                            $this->writeInfo("    ! Skip lang file '$family' !");
                        }
                        continue;
                    }
                }

                if ($this->option('verbose')) {
                    $this->writeLine('');
                }

                $this->writeLine('    '.$lang_file->getShortFilePath());

                if (! $this->option('dry-run')) {

                    if (! $lang_file->ensureFolder()) {
                        // @codeCoverageIgnoreStart
                        $this->writeError("    > Unable to create directory ".$lang_file->getFileFolderPath());

                        return self::ERROR;
                        // @codeCoverageIgnoreEnd
                    }

                    if (! $lang_file->isFolderWritable()) {
                        // @codeCoverageIgnoreStart
                        $this->writeError("    > Unable to write file in directory ".$lang_file->getFileFolderPath());

                        return self::ERROR;
                        // @codeCoverageIgnoreEnd
                    }

                    if (! $lang_file->fileExists()) {
                        // @codeCoverageIgnoreStart
                        $this->writeInfo("    > File has been created");
                        // @codeCoverageIgnoreEnd
                    }

                    if (! $lang_file->touch()) {
                        // @codeCoverageIgnoreStart
                        $this->writeError("    > Unable to touch file ".$lang_file->getFilePath());

                        return self::ERROR;
                        // @codeCoverageIgnoreEnd
                    }

                    if (! $lang_file->isReadable()) {
                        // @codeCoverageIgnoreStart
                        $this->writeError("    > Unable to read file ".$lang_file->getFilePath());

                        return self::ERROR;
                        // @codeCoverageIgnoreEnd
                    }

                    if (! $lang_file->isWritable()) {
                        // @codeCoverageIgnoreStart
                        $this->writeError("    > Unable to write in file ".$lang_file->getFilePath());

                        return self::ERROR;
                        // @codeCoverageIgnoreEnd
                    }
                }

                /** @noinspection PhpIncludeInspection */
                $a                        = $lang_file->load();
                $old_lemmas_with_obsolete = (is_array($a)) ? array_dot($a) : [];
                $new_lemmas               = array_dot($array);
                $final_lemmas             = [];
                $display_already_comment  = false;
                $something_to_do          = false;
                $i                        = 0;

                // Remove the obsolete prefix key
                $old_lemmas             = [];
                $obsolete_prefix_length = strlen($obsolete_prefix);
                foreach ($old_lemmas_with_obsolete as $key => $value) {
                    if (starts_with($key, $obsolete_prefix)) {
                        $key = substr($key, $obsolete_prefix_length);
                        if (! isset($old_lemmas[$key])) {
                            $old_lemmas[$key] = $value;
                        }
                    } else {
                        $old_lemmas[$key] = $value;
                    }
                }

                // Check if keys from new lemmas are not sub-keys from old_lemma (#47)
                // Ignore them if this is the case
                $new_lemmas_clean = $new_lemmas;
                $old_lemmas_clean = $old_lemmas;

                foreach ($new_lemmas as $new_key => $new_value) {
                    foreach ($old_lemmas as $old_key => $old_value) {
                        if (starts_with($old_key, $new_key.'.')) {
                            if ($this->option('verbose')) {
                                $this->writeLine("            <info>".$new_key."</info> seems to be used to access an array and is already defined in lang file as ".$old_key);
                                $this->writeLine("            <info>".$new_key."</info> not handled!");
                            }

                            unset($new_lemmas_clean[$new_key]);
                            unset($old_lemmas_clean[$old_key]);
                        }
                    }
                }

                $obsolete_lemmas = array_diff_key($old_lemmas_clean, $new_lemmas_clean);
                $welcome_lemmas  = array_diff_key($new_lemmas_clean, $old_lemmas_clean);
                $already_lemmas  = array_intersect_key($old_lemmas_clean, $new_lemmas_clean);

                // disable check for obsolete lemma and consolidate with already_lemmas
                if ($this->option('disable-obsolete-check')) {
                    $already_lemmas  = array_unique($obsolete_lemmas + $already_lemmas);
                    $obsolete_lemmas = [];
                }

                ksort($obsolete_lemmas);
                ksort($welcome_lemmas);
                ksort($already_lemmas);

                //////////////////////////
                // Deal with new lemmas //
                //////////////////////////
                if (count($welcome_lemmas) > 0) {
                    $display_already_comment               = true;
                    $something_to_do                       = true;
                    $there_are_new                         = true;
                    $final_lemmas["POTSKY___NEW___POTSKY"] = "POTSKY___NEW___POTSKY";

                    $this->writeInfo('        '.($c = count($welcome_lemmas)).' new string'.Tools::getPlural($c).' to translate');

                    foreach ($welcome_lemmas as $key => $value) {
                        if ($this->option('verbose')) {
                            $this->writeLine("            <info>".$key."</info> in ".$this->manager->getShortPath($value));
                        }
                        if (! $this->option('no-comment')) {
                            $final_lemmas['POTSKY___COMMENT___POTSKY'.$i] = "Defined in file $value";
                            $i                                            = $i + 1;
                        }

                        $key_last_token = preg_split($this->dot_notation_split_regex, $key);

                        if ($this->option('translation')) {
                            $translation = $this->manager->translate(end($key_last_token), $lang);
                        } else {
                            $translation = end($key_last_token);
                        }

                        if (strtolower($this->option('new-value')) === 'null') {
                            $translation = null;
                        } else {
                            $translation = str_replace('%LEMMA', $translation, $this->option('new-value'));
                        }

                        Tools::arraySet($final_lemmas, $key, $translation, $this->dot_notation_split_regex);
                    }
                }

                ///////////////////////////////
                // Deal with existing lemmas //
                ///////////////////////////////
                if (count($already_lemmas) > 0) {
                    if ($this->option('verbose')) {
                        $this->writeLine('        '.($c = count($already_lemmas)).' already translated string'.Tools::getPlural($c));
                    }

                    $final_lemmas["POTSKY___OLD___POTSKY"] = "POTSKY___OLD___POTSKY";

                    foreach ($already_lemmas as $key => $value) {
                        Tools::arraySet($final_lemmas, $key, $value, $this->dot_notation_split_regex);
                    }
                }

                ///////////////////////////////
                // Deal with obsolete lemmas //
                ///////////////////////////////
                if (count($obsolete_lemmas) > 0) {
                    $protected_already_included = false;

                    // Remove all dynamic fields
                    foreach ($obsolete_lemmas as $key => $value) {
                        foreach ($this->never_obsolete_keys as $remove) {
                            if ((strpos($key, '.'.$remove.'.') !== false) || starts_with($key, $remove.'.')) {
                                if ($this->option('verbose')) {
                                    $this->writeLine("        <comment>".$key."</comment> is protected as a dynamic lemma");
                                }

                                unset($obsolete_lemmas[$key]);

                                if ($protected_already_included === false) {
                                    $final_lemmas["POTSKY___PROTECTED___POTSKY"] = "POTSKY___PROTECTED___POTSKY";
                                    $protected_already_included                  = true;
                                }

                                // Given that this lemma is never obsolete, we need to send it back to the final lemma array
                                Tools::arraySet($final_lemmas, $key, $value, $this->dot_notation_split_regex);
                            }
                        }
                    }
                }

                /////////////////////////////////////
                // Fill the final lemmas array now //
                /////////////////////////////////////
                if (count($obsolete_lemmas) > 0) {
                    $display_already_comment = true;
                    $something_to_do         = true;

                    if ($this->option('no-obsolete')) {
                        $this->writeComment("        ".($c = count($obsolete_lemmas)).' obsolete string'.Tools::getPlural($c).' (will be deleted)');
                    } else {
                        $this->writeComment("        ".($c = count($obsolete_lemmas)).' obsolete string'.Tools::getPlural($c).' (can be deleted manually in the generated file)');

                        $final_lemmas["POTSKY___OBSOLETE___POTSKY"] = "POTSKY___OBSOLETE___POTSKY";

                        foreach ($obsolete_lemmas as $key => $value) {
                            if ($this->option('verbose')) {
                                $this->writeLine("            <comment>".$key."</comment>");
                            }

                            Tools::arraySet($final_lemmas, $obsolete_prefix.$key, $value, $this->dot_notation_split_regex);
                        }
                    }
                }

                // Flat style
                if ($this->option('output-flat')) {
                    $final_lemmas = array_dot($final_lemmas);
                }

                if (($something_to_do === true) || ($this->option('force'))) {
                    $content = var_export($final_lemmas, true);
                    $content = preg_replace("@'POTSKY___COMMENT___POTSKY[0-9]*' => '(.*)',@", '// $1', $content);
                    $content = str_replace([
                        "'POTSKY___NEW___POTSKY' => 'POTSKY___NEW___POTSKY',",
                        "'POTSKY___OLD___POTSKY' => 'POTSKY___OLD___POTSKY',",
                        "'POTSKY___PROTECTED___POTSKY' => 'POTSKY___PROTECTED___POTSKY',",
                        "'POTSKY___OBSOLETE___POTSKY' => 'POTSKY___OBSOLETE___POTSKY',",
                    ], [
                        '//============================== New strings to translate ==============================//',
                        ($display_already_comment === true) ? '//==================================== Translations ====================================//' : '',
                        '//============================== Dynamic protected strings =============================//',
                        '//================================== Obsolete strings ==================================//',
                    ], $content);

                    $file_content = "<?php\n";

                    if (! $this->option('no-date')) {
                        $a            = " Generated via \"php artisan ".$this->argument('command')."\" at ".date("Y/m/d H:i:s")." ";
                        $file_content .= "/".str_repeat('*', strlen($a))."\n".$a."\n".str_repeat('*', strlen($a))."/\n";
                    }

                    $file_content                   .= "\nreturn ".$content.";";
                    $job[$lang_file->getFilePath()] = $file_content;
                } else {
                    if ($this->option('verbose')) {
                        $this->writeLine("        > <comment>Nothing to do for this file</comment>");
                    }
                }
            }
        }

        ///////////////////////////////////////////
        // Silent mode                           //
        // only return an exit code on new lemma //
        ///////////////////////////////////////////
        if ($this->option('silent')) {
            if ($there_are_new === true) {
                return self::ERROR;
            } else {
                // @codeCoverageIgnoreStart
                return self::SUCCESS;
                // @codeCoverageIgnoreEnd
            }
        }

        ///////////////////////////////////////////
        // Normal mode                           //
        ///////////////////////////////////////////
        if (count($job) > 0) {

            if ($this->option('no-interaction')) {
                $do = true;
            } // @codeCoverageIgnoreStart
            else {
                $this->writeLine('');
                $do = ($this->ask('Do you wish to apply these changes now? [yes|no]') === 'yes');
                $this->writeLine('');
            }
            // @codeCoverageIgnoreEnd

            if ($do === true) {

                if (! $this->option('no-backup')) {
                    $this->writeLine('Backup files:');

                    $now = $this->manager->getBackupDate();

                    foreach ($job as $file_lang_path => $file_content) {
                        $backup_path = $this->manager->getBackupPath($file_lang_path, $now, $extension);

                        if (! $this->option('dry-run')) {
                            rename($file_lang_path, $backup_path);
                        }

                        $this->writeLine("    <info>".$this->manager->getShortPath($file_lang_path)."</info> -> <info>".$this->manager->getShortPath($backup_path)."</info>");
                    }

                    $this->writeLine('');
                }

                $this->writeLine('Save files:');
                $open_files = '';

                foreach ($job as $file_lang_path => $file_content) {
                    if (! $this->option('dry-run')) {
                        file_put_contents($file_lang_path, $file_content);
                    }

                    $this->writeLine("    <info>".$this->manager->getShortPath($file_lang_path)."</info>");

                    // Fix code style
                    try {
                        $this->manager->fixCodeStyle($file_lang_path, $this->code_style_rules);
                    } // @codeCoverageIgnoreStart
                    catch (Exception $e) {
                        $this->writeError("    Cannot fix code style (".$e->getMessage().")");
                    }
                    // @codeCoverageIgnoreEnd

                    // @codeCoverageIgnoreStart
                    if ($this->option('editor')) {
                        $open_files .= ' '.escapeshellarg($file_lang_path);
                    }
                    // @codeCoverageIgnoreEnd

                }

                $this->writeLine('');
                $this->writeInfo('Process done!');

                // @codeCoverageIgnoreStart
                if ($this->option('editor')) {
                    exec($this->editor.$open_files);
                }
                // @codeCoverageIgnoreEnd

                // @codeCoverageIgnoreStart
            } else {
                $this->writeLine('');
                $this->writeComment('Process aborted. No file has been changed.');
            }
        } // @codeCoverageIgnoreEnd
        else {
            $this->writeLine('');
            $this->writeInfo('Drink a Piña colada and/or smoke Super Skunk, you have nothing to do!');
        }
        $this->writeLine('');

        return self::SUCCESS;
    }
1260031
public function handle()
    {
        parent::handle();

        $modelGenerator = new ModelGenerator($this->commandData);
        $modelGenerator->generate();

        $this->performPostActions();
    }
247577
public function handle()
    {
        $modelname = strtolower($this->argument('model-name'));
        $prefix = \Config::get('database.connections.mysql.prefix');
        $custom_table_name = $this->option('table-name');
        $custom_controller = $this->option('custom-controller');
        $singular = $this->option('singular');

        $tocreate = [];

        if($modelname == 'all') {
            $pretables = json_decode(json_encode(DB::select("show tables")), true);
            $tables = [];
            foreach($pretables as $p) { 
                list($key) = array_keys($p);
                $tables[] = $p[$key]; 
            }
            $this->info("List of tables: ".implode($tables, ","));
            
            foreach ($tables as $t) {
                // Ignore tables with different prefix
                if($prefix == '' || str_contains($t, $prefix)) { 
                    $t = strtolower(substr($t, strlen($prefix)));
                    $toadd = ['modelname'=> str_singular($t), 'tablename'=>''];
                    if(str_plural($toadd['modelname']) != $t) {
                        $toadd['tablename'] = $t;
                    } 
                    $tocreate[] = $toadd;
                }
            }
            // Remove options not applicabe for multiples tables
            $custom_table_name = null;
            $custom_controller = null;
            $singular = null;
        }
        else {

            $tocreate = [
                'modelname' => $modelname,
                'tablename' => '',
            ];
            if($singular) {
                $tocreate['tablename'] = strtolower($modelname);    
            }
            else if($custom_table_name) { 
                $tocreate['tablename'] = $custom_table_name; 
            }

            $tocreate = [$tocreate];
        }



        foreach ($tocreate as $c) {
            $generator = new \CrudGenerator\CrudGeneratorService();
            $generator->output = $this;

            $generator->appNamespace = Container::getInstance()->getNamespace();
            $generator->modelName = ucfirst($c['modelname']);
            $generator->tableName = $c['tablename'];

            $generator->prefix = $prefix;
            $generator->force = $this->option('force');
            $generator->layout = $this->option('master-layout');
            $generator->controllerName = ucfirst(strtolower($custom_controller)) ?: str_plural($generator->modelName);

            $generator->Generate();
        }

    }
925579
public function handle()
    {
	    $name = $this->argument('name');
	    $moduleName = $this->option('module');
	    
	    
	    if(empty($moduleName))
	        $moduleName = $this->ask('Please provide the name of the module');
	    
	    $dir = 'migrations';
	    $modulePath = Module::get($moduleName)->relativePath;
	    $source = $modulePath . DIRECTORY_SEPARATOR . $dir;
	    
	    if(!is_dir(base_path($source))) {
	    	mkdir(base_path($source), 0775, true);
	    }
	    
	    
	    $this->call('make:migration', [
	    	'name' => $name,
		    '--path' => $source,
		    '--table' => $this->option('table'),
		    '--create' => $this->option('create'),
	    ]);
    }