How to enable query log in laravel?

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) Example DB::connection()->enableQueryLog(); $result = User:where(['status' => 1])->get(); $log = DB::getQueryLog(); dd($log);

Popular posts from this blog

SQL In Static Id Wise Record Skip After Show Result