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
623623 {
624624 $ sql = $ query ['query ' ];
625625 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 ) {
628635 $ bindings = $ this ->getDataFormatter ()->checkBindings ($ query ['bindings ' ]);
629636 if (!empty ($ bindings )) {
630637 $ pdo = null ;
You can’t perform that action at this time.
0 commit comments