How to print query or debug queries in Laravel
We often need to debug large queries in Laravel. And laravel have built-in functions almost for everything. Here is a simple query in laravel for example. $data = User::where(‘status’, 1) ->select(‘name’, ‘username’, ‘email’, ‘password’) ->get(); but we want to see the sql query. So we have to use toSql() in the place of get() […]