how to enable query log in laravel?
ReportQuestion
2 years ago 795 views
Our first step should be DB::connection()->enableQueryLog(); After our query, it should be placed $querieslog = DB::getQueryLog(); After that, it should be placed dd($querieslog)
DB::connection()->enableQueryLog();
$result = User:where(['status' => 1])->get();
$log = DB::getQueryLog();
dd($log);
Thread Reply