diff --git a/src/Illuminate/Http/Client/PendingRequest.php b/src/Illuminate/Http/Client/PendingRequest.php index cfab639cf511..ba910f833111 100644 --- a/src/Illuminate/Http/Client/PendingRequest.php +++ b/src/Illuminate/Http/Client/PendingRequest.php @@ -1008,6 +1008,10 @@ protected function makePromise(string $method, string $url, array $options = []) }); }) ->otherwise(function (TransferException $e) { + if ($e instanceof ConnectException) { + $this->dispatchConnectionFailedEvent(); + } + return $e instanceof RequestException && $e->hasResponse() ? $this->populateResponse($this->newResponse($e->getResponse())) : $e; }); }