From 126bb9a2e2690fe8811cf80be60d6902fe671d85 Mon Sep 17 00:00:00 2001 From: akaDJon Date: Fri, 28 Nov 2025 11:52:06 +0500 Subject: [PATCH 1/2] Update formatMessage to use getRawSql method wrong sql string fix --- src/Illuminate/Database/QueryException.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Database/QueryException.php b/src/Illuminate/Database/QueryException.php index a83657188538..1b6ccac2848b 100644 --- a/src/Illuminate/Database/QueryException.php +++ b/src/Illuminate/Database/QueryException.php @@ -64,7 +64,7 @@ public function __construct($connectionName, $sql, array $bindings, Throwable $p */ protected function formatMessage($connectionName, $sql, $bindings, Throwable $previous) { - return $previous->getMessage().' (Connection: '.$connectionName.', SQL: '.Str::replaceArray('?', $bindings, $sql).')'; + return $previous->getMessage().' (Connection: '.$connectionName.', SQL: '.$this->getRawSql().')'; } /** From 20a88386b9d14d004c4e4328fbe4524787abaaf5 Mon Sep 17 00:00:00 2001 From: akaDJon Date: Fri, 28 Nov 2025 13:06:25 +0500 Subject: [PATCH 2/2] Remove unused Str import from QueryException --- src/Illuminate/Database/QueryException.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Illuminate/Database/QueryException.php b/src/Illuminate/Database/QueryException.php index 1b6ccac2848b..04ef5c4b155d 100644 --- a/src/Illuminate/Database/QueryException.php +++ b/src/Illuminate/Database/QueryException.php @@ -3,7 +3,6 @@ namespace Illuminate\Database; use Illuminate\Support\Facades\DB; -use Illuminate\Support\Str; use PDOException; use Throwable;