Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

How to print query in laravel

$empoyee = Employee::select("*")->get();
$quries = DB::getQueryLog();
dd($quries);
DB::table('empoyee')->toSql();
dd($query);



DB::enableQueryLog(); // This function enable query log
// Eloquent query executed by using get()
dd(DB::getQueryLog()); // Show results of log
//path : storage/logs/laravel-2022-03-31.log
 
PREVIOUS NEXT
Tagged: #How #print #query #laravel
ADD COMMENT
Topic
Name
4+5 =