diff --git a/src/Illuminate/Database/Concerns/ManagesTransactions.php b/src/Illuminate/Database/Concerns/ManagesTransactions.php index bbefb1e4051b..4d1d2b8efffe 100644 --- a/src/Illuminate/Database/Concerns/ManagesTransactions.php +++ b/src/Illuminate/Database/Concerns/ManagesTransactions.php @@ -186,7 +186,7 @@ public function commit() */ protected function handleCommitTransactionException($e, $currentAttempt, $maxAttempts) { - $this->transactions--; + $this->transactions = max(0, $this->transactions - 1); if ($this->causedByConcurrencyError($e) && $currentAttempt < $maxAttempts) {