I tried to achieve this by listening to request events, but I don't seem to know how I got the bill. This is just getting a list of queries, since the callback function cannot be changed to return the count variable:
DB::listen(function ($query) {
var_dump('<pre>'.$query->sql.</pre>);
});
I need a solution to count every page executed with Laravel.
source
share