Monday 22 August 2016

Laravel : Get SQL of a DB object

Hello,

How to print SQL (Select statement) of DB Object in Laravel:

$sql = DB::table('users');
echo $sql->toSql();

Best regards,
Iban Cardona.

No comments:

Post a Comment