In the login method, auth()->attempt($validated) is setting Auth::check() to true.
If your test route has "auth" middleware, and you are logged in, it should return true.
Is the test route public? If yes, Auth::check() may return false.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
i have this error in the login functionality when i try to log in the Auth::check() return true in the same livewire class
this is the code
public function login()
{
$validated = $this->validate([
'email' => 'required|email',
'password' => 'required|min:8'
]);
if (auth()->attempt($validated)) {
session()->regenerate();
}
$this->reset();
dd(Auth::check());
}
but when i try to dd(Auth::check()) in the web.php file where all the routs i get false thsi is the code
Route::get('/test', function(){ dd(Auth::check()); })->name('test');
how to fix that
Please or to participate in this conversation.