Most suitable way to go about this is listen to db queries. You can do
\DB::listen(function ($query) {
dump($query->sql);
dump($query->bindings);
dump($query->time);
})
in your route file. this will dump out executing db queries. But if you want a much cleaner approach you could wrap above listener inside laravel logger like this.
\Log::info(
\DB::listen(function ($query) {
dump($query->sql);
dump($query->bindings);
dump($query->time);
})
);
then the output will be dump into your-app/storage/logs/laravel.log.
NOTE: Keep in mind to remove or comment out above codes as they are for development purpose only.
Further, you could put it in AppServiceProvider like it is mentioned in database transactions