Last active
August 23, 2016 05:04
-
-
Save mehranhadidi/703a0c632e54e421d8b289423327a714 to your computer and use it in GitHub Desktop.
Log SQL queries in laravel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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