Created
March 16, 2026 10:32
-
-
Save jkirira/48cd657c30d0410d30cf0d82982bb9df to your computer and use it in GitHub Desktop.
QueryLog
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 | |
| \DB::enableQueryLog(); | |
| $res = $this->sortFilterPaginate($transaction, function ($model) { | |
| return (new TransactionUiTransformer())->transformOut($model); | |
| }, [], $filterFunction); | |
| $log = \DB::getQueryLog()[0]; | |
| $formatted = $log['query']; | |
| foreach ($log['bindings'] as $binding) { | |
| $pos = strpos($formatted, '?'); | |
| if ($pos !== false) { | |
| $formatted = substr_replace($formatted, "'" . $binding ."'", $pos, 1); | |
| } | |
| } | |
| dd($formatted, $log, $log['bindings']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment