I am getting error when i am logout, it's showing me this error..."The GET method is not supported for this route. Supported methods: POST." Please help me to solve this issue..
Here are my code...
@if(Auth::check())
<li><i class="fa fa-user"></i> {{Auth::user()->name}}:
<a href="{{url('logout')}}">logout</a>
</li>
@else
<li>
<a href="{{route('login')}}"><i class="fa fa-user"></i>Login</a>
</li>
@endif
In my previous post, we implement the authentication, now we will talk about Laravel auth logout. Logout is one of the important functionality to implement in a web application when users log in they should have an option to log out of their account and secure it.
To manually log users out of your application, you may use the logout method provided by the Auth facade. This will remove the authentication information from the user's session so that subsequent requests are not authenticated.
How do I change the logout of a route in Laravel? Add a custom logout route in Auth/LoginController, call Auth::logout() and return redirect to your path, or. Add an after-middleware (say redirectAfterLogout) and add it to the logout route.
You could just add this line in your web.php
routes file:
Route::get('/logout', 'Auth\LoginController@logout');
This allows you to logout by using a GET
Request.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With