Created
January 21, 2022 11:05
-
-
Save adrianodias8/9d0fd23458de630b24dbdb0c7e7571ad to your computer and use it in GitHub Desktop.
Laravel Print query with bindings
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
| <?php | |
| dd(vsprintf(str_replace('?', '%s', $query->toSql()), collect($query->getBindings())->map(function ($binding) { | |
| return is_numeric($binding) ? $binding : "'{$binding}'"; | |
| })->toArray())); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment