Last active
December 6, 2018 17:12
-
-
Save nathanmac/c63dda82b648cc322f2d153c9b22101a to your computer and use it in GitHub Desktop.
db debugging lines for lumen
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
\DB::listen(function($sql) { | |
if ($sql instanceof Illuminate\Database\Events\QueryExecuted) { | |
\Log::info($sql->sql); | |
\Log::info(json_encode($sql->bindings)); | |
} | |
}); | |
DB::listen( | |
function ($query) { | |
Log::info($query->sql); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment