laravel log query for model

35

DB::enableQueryLog();
$arr_user = DB::table('users')->select('name', 'email as user_email')->get();
dd(DB::getQueryLog());
public function show(Order $order){
    \DB::connection()->enableQueryLog();
    $data = $order->all();
    $queries = \DB::getQueryLog();
    return dd($queries);
}

Comments

Submit
0 Comments