Skip to content

Instantly share code, notes, and snippets.

@nasrulhazim
Created November 5, 2019 02:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nasrulhazim/84efdbc00c901849e5893873b752585e to your computer and use it in GitHub Desktop.
Save nasrulhazim/84efdbc00c901849e5893873b752585e to your computer and use it in GitHub Desktop.
Recache all Laravel caches - `reload:cache`
<?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