only('name', 'password'); if (Auth::attempt($credentials, true)) { return redirect()->intended('/'); } return redirect()->route('login'); } /** * Show the form to allow a user to log-out. */ public function showLogout(): View|RedirectResponse { if (Auth::check() === false) { // The user is not logged in, just redirect them home return redirect('/'); } return view('logout'); } /** * Log the user out from their current session. */ public function logout(): RedirectResponse { Auth::logout(); return redirect('/'); } }