Skip to content

Instantly share code, notes, and snippets.

@mehranhadidi
Last active August 23, 2016 05:04
Show Gist options
  • Save mehranhadidi/703a0c632e54e421d8b289423327a714 to your computer and use it in GitHub Desktop.
Save mehranhadidi/703a0c632e54e421d8b289423327a714 to your computer and use it in GitHub Desktop.
Log SQL queries in laravel
// should add to AppServiceProvider@boot
\DB::listen(function ($query) { \Log::info($query->sql, $query->bindings); });
// should add to routes.php
Event::listen('illuminate.query', function($query)
{
var_dump($query);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment