Created
June 17, 2014 13:01
-
-
Save JSila/4ed34b28daccbaf63784 to your computer and use it in GitHub Desktop.
Laravel: Var dumping SQL queries
This file contains hidden or 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, $bindings) { | |
$sql = str_replace(['%', '?'], ['%%', '%s'], $sql); | |
var_dump(vsprintf($sql, $bindings)); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment