From d8ece27964282f1639fdf7575fac59df0c008e09 Mon Sep 17 00:00:00 2001 From: Saeed Vaziry <61919774+saeedvaziry@users.noreply.github.com> Date: Thu, 27 Feb 2025 22:19:50 +0100 Subject: [PATCH] Add logs:clear command (#509) --- app/Console/Commands/ClearLogsCommand.php | 26 +++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 app/Console/Commands/ClearLogsCommand.php diff --git a/app/Console/Commands/ClearLogsCommand.php b/app/Console/Commands/ClearLogsCommand.php new file mode 100644 index 0000000..ac531d6 --- /dev/null +++ b/app/Console/Commands/ClearLogsCommand.php @@ -0,0 +1,26 @@ +info('Clearing logs...'); + + ServerLog::query()->delete(); + + File::cleanDirectory(Storage::disk('server-logs')->path('')); + + $this->info('Logs cleared!'); + } +}