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

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

Execute the console command.
public handle ( ) : void
Результат void
    public function handle()
    {
        $old_cache_driver = $this->laravel['config']['cache.default'];
        $file = base_path('.env');
        if (file_exists($file)) {
            file_put_contents($file, str_replace('CACHE_DRIVER=' . $old_cache_driver, 'CACHE_DRIVER=' . $this->argument('cachedriver'), file_get_contents($file)));
            return $this->info('The cache driver has been changed ' . 'successfully to: ' . $this->argument('cachedriver'));
        }
        return $this->error('The .env configuration file is missing.');
    }