fix : Trait 추가 및 query 디버깅 소스 수정

This commit is contained in:
2025-07-26 14:25:45 +09:00
parent 8a4a7c9508
commit 214adc8de1
6 changed files with 51 additions and 7 deletions

View File

@@ -2,6 +2,7 @@
namespace App\Providers;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
@@ -20,5 +21,14 @@ public function register(): void
public function boot(): void
{
//
Builder::macro('debug', function($debug = null) {
if (is_null($debug) && app()->environment('local')) {
$debug = true;
}
if ($debug) {
\DB::enableQueryLog();
}
return $this;
});
}
}