Sebpro\ArtisanExt\Commands\ExtLocale::handle PHP Метод

handle() публичный Метод

Execute the console command.
public handle ( ) : void
Результат void
    public function handle()
    {
        $old_locale = $this->laravel['config']['app.locale'];
        $file = config_path() . '/app.php';
        if (file_exists($file)) {
            file_put_contents($file, str_replace("'locale' => '" . $old_locale . "',", "'locale' => '" . $this->argument('locale') . "',", file_get_contents($file)));
            return $this->info('The locale has been changed ' . 'successfully to: ' . $this->argument('locale'));
        }
        return $this->error('The app.php configuration file is missing.');
    }