From 2c859ac3b5a2990e2f06e6449129a98a6de93191 Mon Sep 17 00:00:00 2001 From: Afiq Hamzah Date: Thu, 8 Aug 2024 12:40:42 +0800 Subject: [PATCH] Add clear caches command to laravel --- app/Console/Commands/ClearAllCaches.php | 41 +++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 app/Console/Commands/ClearAllCaches.php diff --git a/app/Console/Commands/ClearAllCaches.php b/app/Console/Commands/ClearAllCaches.php new file mode 100644 index 0000000..2dea67e --- /dev/null +++ b/app/Console/Commands/ClearAllCaches.php @@ -0,0 +1,41 @@ +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.'); + } +}