Created
May 28, 2015 22:43
-
-
Save faulker/c1401110ae0c1456c072 to your computer and use it in GitHub Desktop.
Laravel DB Debug
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
function listenForSqlAndDisplay() | |
{ | |
\DB::listen(function($sql, $bindings) | |
{ | |
foreach ($bindings as $val) { | |
$sql = preg_replace('/\?/', "'{$val}'", $sql, 1); | |
} | |
var_dump($sql); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment