Created
November 5, 2019 02:43
-
-
Save nasrulhazim/84efdbc00c901849e5893873b752585e to your computer and use it in GitHub Desktop.
Recache all Laravel caches - `reload:cache`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Console\Commands\Reload; | |
use Illuminate\Console\Command; | |
class ReloadCacheCommand extends Command | |
{ | |
/** | |
* The name and signature of the console command. | |
* | |
* @var string | |
*/ | |
protected $signature = 'reload:cache'; | |
/** | |
* The console command description. | |
* | |
* @var string | |
*/ | |
protected $description = 'Reload all caches'; | |
/** | |
* Create a new command instance. | |
*/ | |
public function __construct() | |
{ | |
parent::__construct(); | |
} | |
/** | |
* Execute the console command. | |
* | |
* @return mixed | |
*/ | |
public function handle() | |
{ | |
$this->call('cache:clear'); | |
$this->call('config:cache'); | |
$this->call('route:cache'); | |
$this->call('view:clear'); | |
$this->info('Successfully reload caches.'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment