From 6e71be384ea21af62b7224a01850389b17559336 Mon Sep 17 00:00:00 2001 From: Afiq Hamzah Date: Fri, 9 Aug 2024 18:25:35 +0800 Subject: [PATCH] Add artisan clear-cache-all command --- app/Console/Commands/ClearCachesAll.php | 78 +++++++++++++++++++++++++ app/Console/Kernel.php | 2 + 2 files changed, 80 insertions(+) create mode 100644 app/Console/Commands/ClearCachesAll.php diff --git a/app/Console/Commands/ClearCachesAll.php b/app/Console/Commands/ClearCachesAll.php new file mode 100644 index 0000000..9f76333 --- /dev/null +++ b/app/Console/Commands/ClearCachesAll.php @@ -0,0 +1,78 @@ +&1', $output, $returnVar); + + // Output the result of the Composer command + if ($returnVar === 0) { + $this->info("Composer install ran successfully:\n" . implode("\n", $output)); + } else { + $this->error("Composer install failed:\n" . implode("\n", $output)); + } + + $this->info("All caches have been cleared."); + } +} diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index bc4d60e..8f98b9f 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -19,6 +19,8 @@ class Kernel extends ConsoleKernel Commands\DailyGadai::class, Commands\MigrationOnePercent::class, Commands\CawanganDebugConnections::class, + Commands\ClearSessions::class, + Commands\ClearCachesAll::class, ];