1.

How to enable query log in laravel?

Answer»

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);



Discussion

No Comment Found