Do you know Laravel have a new function that allow us to print out sql?
In Laravel version 10 have release function toRawSql.
// Using the new `toRawSql()` method
// "SELECT * FROM users WHERE email = 'email@example.com'"
There is some prior art before
toRawSql()—various developer tools (i.e., Laravel Debugbar) give you queries, and there's a
dd() method you can use as well:
// Using the dd() method
// "SELECT * FROM users WHERE email = ?"
// 0 => "firstname.lastname@example.org"
Read More Laravel Debugging Stories:
Introduction of Laravel Debuggar
This article will talk more about barryvdh/laravel-debugbar.
Modern Debugging Tool for Laravel Developer
Do you know that we have a modern debugging tool can allow us to dump out all the places we need to track instead of we…