My team and I are working on a rather big project. There\'s queries going on everywhere - in controllers, in view composers in views (lazy loading) and probably in some othe
Here comes the perfect example:
https://laravel.com/docs/5.3/database#listening-for-query-events
Open app\Providers\AppServiceProvider.php and add the following to Boot() function:
Boot()
DB::listen(function ($query) { var_dump([ $query->sql, $query->bindings, $query->time ]); });