From 2db7baa56cbc3172d9ec97d768ff63b8e44fd204 Mon Sep 17 00:00:00 2001 From: Angelin Calu Date: Sun, 14 Sep 2025 20:25:08 +0300 Subject: [PATCH] Correct LoginRequest retrieved user type to allow null The issue was caused by a too-strict PHPDoc that assumed the retrieved user is always a User. However, `retrieveByCredentials()` can return null. This aligns the docblock with the actual return type, making the subsequent null/credential checks type-safe. --- app/Http/Requests/Auth/LoginRequest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Requests/Auth/LoginRequest.php b/app/Http/Requests/Auth/LoginRequest.php index 0378ad74..57f53acc 100644 --- a/app/Http/Requests/Auth/LoginRequest.php +++ b/app/Http/Requests/Auth/LoginRequest.php @@ -41,7 +41,7 @@ public function validateCredentials(): User { $this->ensureIsNotRateLimited(); - /** @var User $user */ + /** @var User|null $user */ $user = Auth::getProvider()->retrieveByCredentials($this->only('email', 'password')); if (! $user || ! Auth::getProvider()->validateCredentials($user, $this->only('password'))) {