Display executed queries in Laravel Eloquent

Add the below piece of code to you app. Generally in routes.php.

Event::listen('illuminate.query',function($sql)
{
       var_dump($sql."<br/>");
       $queries = DB::getQueryLog();
       var_dump(end($queries));
});

Enjoyed this post? Share it!