Created
July 7, 2023 07:01
-
-
Save ryanKinoti/bb47050983c3165f22f64f6f3e94b8c4 to your computer and use it in GitHub Desktop.
route redirect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function accounts() | |
{ | |
if (request()->is('auth/login')) { | |
$user = Auth::user(); | |
if ($user == null) { | |
return view('auth.login'); | |
} | |
return redirect("/")->withErrors(['error' => "You are already logged in"]); | |
} elseif (request()->is('auth/registration')) { | |
return view('auth.registration'); | |
} elseif (request()->is('auth/reset')) { | |
return view('auth.reset_request'); | |
} else { | |
abort(404); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment