Skip to content

Commit 5540e59

Browse files
authored
Update ServiceProvider.php
1 parent 32ee741 commit 5540e59

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/ServiceProvider.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,10 @@ public function boot()
3232

3333
$bindings = $query->connection->prepareBindings($query->bindings);
3434
$pdo = $query->connection->getPdo();
35-
if (count($bindings)) {
36-
$pdo = $query->connection->getPdo();
37-
$realSql = vsprintf($sqlWithPlaceholders, array_map([$pdo, 'quote'], $bindings));
38-
} else {
39-
$realSql = $sqlWithPlaceholders;
35+
$realSql = $sqlWithPlaceholders;
36+
37+
if (count($bindings) > 0) {
38+
$realSql = vsprintf($sqlWithPlaceholders, array_map([$pdo, 'quote'], $bindings));
4039
}
4140

4241
Log::debug(sprintf('[%s] %s | %s: %s', $duration, $realSql, request()->method(), request()->getRequestUri()));

0 commit comments

Comments
 (0)