Created
November 20, 2022 10:07
-
-
Save jpswade/5651aac4b74cc3d711ea0b485ee582c1 to your computer and use it in GitHub Desktop.
How to get the full SQL query with bindings using Laravel Eloquent
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 | |
/** How to get the full SQL query with bindings using Laravel Eloquent **/ | |
dd(vsprintf(str_replace('?', '\'%s\'', str_replace('%', '%%', $query->toSql())), $query->getBindings())); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment