From d2d6c0aa4785aed566f7e61015a3e6ebb0f83adf Mon Sep 17 00:00:00 2001 From: Afiq Hamzah Date: Sat, 10 Aug 2024 07:20:57 +0800 Subject: [PATCH] Add to clear-caches-all command to show output when exec restart supervisor --- app/Console/Commands/ClearCachesAll.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/Console/Commands/ClearCachesAll.php b/app/Console/Commands/ClearCachesAll.php index a4ab10d..2e46171 100644 --- a/app/Console/Commands/ClearCachesAll.php +++ b/app/Console/Commands/ClearCachesAll.php @@ -77,6 +77,13 @@ class ClearCachesAll extends Command $output = []; $returnVar = null; exec('php artisan supervisor:restart 2>&1', $output, $returnVar); + + // output result of command RestartSupervisor + if ($returnVar === 0) { + $this->info("Restart Supervisor ran successfully:\n" . implode("\n", $output)); + } else { + $this->error("Restart Supervisor failed:\n" . implode("\n", $output)); + } $this->info("All caches have been cleared."); }