Skip to content

Instantly share code, notes, and snippets.

@nathanmac
Last active December 6, 2018 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathanmac/c63dda82b648cc322f2d153c9b22101a to your computer and use it in GitHub Desktop.
Save nathanmac/c63dda82b648cc322f2d153c9b22101a to your computer and use it in GitHub Desktop.
db debugging lines for lumen
\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