Just a quick tip on how to redirect to a different route after logging out with Laravel 5.7 or above. I haven't tested with Laravel 10 nor with breeze scaffolding installed just be aware. There is no need to extend from a class or other contrived method to achieve a redirect to a different route ― you only need to put one class method into Laravel's original LoginController
class and that's it.
// ... etc ...
public function logout()
{
auth()->logout();
return redirect()->to('/login');
}
// ... etc ...
Quick, simple and easy.
Content on this site is licensed under a Creative Commons Attribution 4.0 International License. You are encouraged to link to, and share but with attribution.
Copyright ©2024 Leslie Quinn.