File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -623,8 +623,15 @@ private function getSqlQueryToDisplay(array $query): string
623
623
{
624
624
$ sql = $ query ['query ' ];
625
625
if ($ query ['type ' ] === 'query ' && $ this ->renderSqlWithParams && method_exists (DB ::connection ($ query ['connection ' ])->getQueryGrammar (), 'substituteBindingsIntoRawSql ' )) {
626
- $ sql = DB ::connection ($ query ['connection ' ])->getQueryGrammar ()->substituteBindingsIntoRawSql ($ sql , $ query ['bindings ' ] ?? []);
627
- } elseif ($ query ['type ' ] === 'query ' && $ this ->renderSqlWithParams ) {
626
+ try {
627
+ $ sql = DB ::connection ($ query ['connection ' ])->getQueryGrammar ()->substituteBindingsIntoRawSql ($ sql , $ query ['bindings ' ] ?? []);
628
+ return $ this ->getDataFormatter ()->formatSql ($ sql );
629
+ } catch (\Throwable $ e ) {
630
+ // Continue using the old substitute
631
+ }
632
+ }
633
+
634
+ if ($ query ['type ' ] === 'query ' && $ this ->renderSqlWithParams ) {
628
635
$ bindings = $ this ->getDataFormatter ()->checkBindings ($ query ['bindings ' ]);
629
636
if (!empty ($ bindings )) {
630
637
$ pdo = null ;
You can’t perform that action at this time.
0 commit comments