validate([ Fortify::username() => 'required|string', 'password' => 'required|string', ]); $user = User::where('email', $request->email)->first(); if ($user && Hash::check($request->password, $user->password)) { return $user; } return null; } }