Skip to content

Commit f0b397a

Browse files
committed
feat: use Laravel specific implementation to build raw sql when available
1 parent 14348be commit f0b397a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Helpers/DatabaseHelper.php

+5
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ class DatabaseHelper
1717
*/
1818
public function buildRawSql(Connection $db, string $sql, array $bindings = []): string
1919
{
20+
$grammar = $db->getQueryGrammar();
21+
if (method_exists($grammar, 'substituteBindingsIntoRawSql')) {
22+
return $grammar->substituteBindingsIntoRawSql($sql, $bindings);
23+
}
24+
2025
$escapedBindings = [];
2126
foreach ($db->prepareBindings($bindings) as $binding) {
2227
if ($binding === null) {

0 commit comments

Comments
 (0)