Skip to content

Commit

Permalink
Merge pull request #38 from guanguans/patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue authored Jul 26, 2023
2 parents f9cf0b6 + e189cc1 commit 280b06d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ public function boot()
$duration = $this->formatDuration($query->time / 1000);

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

0 comments on commit 280b06d

Please sign in to comment.