Closed Dreamborg closed 7 years ago
For logout better use post
method.
For example:
<a href="{{ route('logout') }}" onclick="event.preventDefault(); document.getElementById('logout-form').submit();">Logout</a>
<form id="logout-form" action="{{ route('logout') }}" method="POST" style="display: none;">
{{ csrf_field() }}
</form>
Wasn't able to get the logout function working with the README's: Route::post('logout', 'Auth\LoginController@logout')->name('logout');
This was done on a fresh install of Laravel.
I was able to get it to work using a get request instead.
Route::get('logout', 'Auth\LoginController@logout')->name('logout');