From b1c5f0d771fc390e303a3d8c5437b8fd3cb1dedd Mon Sep 17 00:00:00 2001 From: sundayenglish Date: Fri, 27 Jun 2025 14:45:32 +0700 Subject: [PATCH] Add Base Controller --- routes/console.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/routes/console.php b/routes/console.php index 3c9adf1..7326ea8 100644 --- a/routes/console.php +++ b/routes/console.php @@ -2,7 +2,25 @@ use Illuminate\Foundation\Inspiring; use Illuminate\Support\Facades\Artisan; +use Illuminate\Support\Facades\DB; Artisan::command('inspire', function () { $this->comment(Inspiring::quote()); })->purpose('Display an inspiring quote'); + +// xóa tất cả các cache +Artisan::command('app:clean', function () { + $this->call('cache:clear'); + $this->call('config:clear'); + $this->call('view:clear'); + $this->call('route:clear'); + $this->info("App cache cleared."); +}); + +// kiểm tra trình trạng database, storage +Artisan::command('system:check', function () { + $db = DB::connection()->getDatabaseName(); + $storage = storage_path(); + $this->info("Database: {$db}"); + $this->info("Storage path: {$storage}"); +});