Skip to content

Commit 280b06d

Browse files
authored
Merge pull request #38 from guanguans/patch-2
2 parents f9cf0b6 + e189cc1 commit 280b06d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/ServiceProvider.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ public function boot()
4545
$duration = $this->formatDuration($query->time / 1000);
4646

4747
if (count($bindings) > 0) {
48-
$realSql = vsprintf($sqlWithPlaceholders, array_map([$pdo, 'quote'], $bindings));
48+
$realSql = vsprintf($sqlWithPlaceholders, array_map(
49+
static fn($binding) => $binding === null ? 'NULL' : $pdo->quote($binding),
50+
$bindings
51+
));
4952
}
5053
Log::channel(config('logging.query.channel', config('logging.default')))
5154
->debug(sprintf('[%s] [%s] %s | %s: %s', $query->connection->getDatabaseName(), $duration, $realSql,

0 commit comments

Comments
 (0)