Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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: #print #query #laravel
ADD COMMENT
Topic
Name
8+4 =