Add clear caches command to laravel
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class ClearAllCaches extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'clear-caches';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Clear all caches in the application';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$this->callSilent('config:clear');
|
||||
$this->callSilent('cache:clear');
|
||||
$this->callSilent('event:clear');
|
||||
$this->callSilent('route:clear');
|
||||
$this->callSilent('view:clear');
|
||||
$this->callSilent('clear-compiled');
|
||||
$this->callSilent('optimize:clear');
|
||||
$this->callSilent('package:discover');
|
||||
$this->callSilent('queue:clear');
|
||||
$this->callSilent('schema:clear');
|
||||
|
||||
$this->info('All caches cleared.');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user