diff --git a/src/Listeners/QueryListener.php b/src/Listeners/QueryListener.php index 64ce7c4..2e051e1 100644 --- a/src/Listeners/QueryListener.php +++ b/src/Listeners/QueryListener.php @@ -35,7 +35,8 @@ class QueryListener { if (env('APP_DEBUG')) { $sql = str_replace("?", "'%s'", $event->sql); - $this->logger->debug(vsprintf($sql, $event->bindings), ['conn' => $event->connectionName, 'time' => $event->time.'ms']); + $log = $event->bindings ? vsprintf($sql, $event->bindings) : $sql; + $this->logger->debug($log, ['conn' => $event->connectionName, 'time' => $event->time.'ms']); } }