DB::queryenable log code example
Example 1: enablequerylog laravel
\DB::enableQueryLog();
dd(\DB::getQueryLog());
Example 2: eloquent get query log
DB::connection()->enableQueryLog(); //enable query log
$data = $order->all(); //query execute
$queries = DB::getQueryLog(); //get query
return dd($queries); //show query