query print in laravel sql code example
Example 1: print query statement in laravel
DB::enableQueryLog();
$users = User::select("*")->get();
$quries = DB::getQueryLog();
dd($quries);
DB::table('users')->toSql();
dd($query);
Example 2: echo query in laravel
DB::enableQueryLog();
# your code
dd(DB::getQueryLog());
DB::disableQueryLog();