Fastest way is to add this to your route, controller action or even app/start/global.php:
DB::listen(function($sql, $bindings, $time) {
Log::info($sql);
});
It log it, so you can then
php artisan tail
To see your queries.
If you need to log just one query direct to the page it's almost the same, you just put it in the place the query is executed:
DB::listen(function($sql, $bindings, $time) {
var_dump($sql);
var_dump($bindings);
});
Posts::where('title', 'My First Post')->get();
die;
And it will echo it in the page.
You can also use the Clockwork Chrome extension (https://chrome.google.com/webstore/detail/clockwork/dmggabnehkmmfmdffgajcflpdjlnoemp?hl=en), this is the PHP package to be installed on Laravel: https://github.com/itsgoingd/clockwork.
Clockwork gives you a really nice profiling view of your application.