Answers for "print query in laravel eloquent"

PHP
0

print query statement in laravel

DB::enableQueryLog();
$users = User::select("*")->get();
$quries = DB::getQueryLog();
dd($quries);
DB::table('users')->toSql();
dd($query);
Posted by: Guest on February-25-2021
6

print last sql query laravel

DB::enableQueryLog(); // Enable query log

// Your Eloquent query executed by using get()

dd(DB::getQueryLog()); // Show results of log
Posted by: Guest on May-09-2020
0

show query in laravel

Use the toSql() method on a QueryBuilder instance.

DB::table('users')->toSql()
Posted by: Guest on January-18-2021

Code answers related to "print query in laravel eloquent"

Browse Popular Code Answers by Language