fix : Trait 추가 및 query 디버깅 소스 수정
This commit is contained in:
@@ -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;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user