Laravel Fortify and logout Hey everyone,
Does anyone know how the Laravel Fortify logout route works? and how to use it on a button or on an a tag to logout the current user?
Logout has to be a post request. So with javascript submit a form when you click on the Logout link.
<a href="{{ route('logout') }}" onclick="event.preventDefault(); document.getElementById('logout-form').submit();">
Logout
</a>
<form id="logout-form" action="{{ route('logout') }}" method="POST">
@csrf
</form>
thanks for the reply that solved my problem now there is a new question which is how change the redirect path in which the user is being redirected after login out?
Please sign in or create an account to participate in this conversation.