Monday, 29 September 2014

How to print SQL Query in Lravel 4.2

To output to the screen the last queries ran you can use this


dd(DB::getQueryLog());


Use the toSql() method on a QueryBuilder instance.

DB::table('users')->toSql() would return: 

select * from `users`

 
 

No comments:

Post a Comment