I'm using multi auth for Laravel ...
This is my lougout function for users
LoginController
public function logout()
{
Auth::guard('web')->logout();
return redirect('/');
}
AdminloginController
public function logout()
{
Auth::guard('web')->logout();
return redirect('/');
}
This is my route
Route::get('/enseignant/logout', 'Auth\LoginController@Elogout')->name('enseignant.logout');
Route::get('/administration/logout', 'Auth\AdminloginController@logout')->name('admin.logout');
All the methods in the view
<a href="{{ route('admin.logout') }}" class="btn btn-default btn-flat"
onclick="event.preventDefault();
document.getElementById('logout-form').submit();">
Logout
</a>
<form id="logout-form" action="{{ route('admin.logout') }}" method="POST" style="display: none;">
{{ csrf_field() }}
</form>
The function works fine but when I click the button I get this error :
MethodNotAllowedHttpException in RouteCollection.php line 233
RouteCollection.php line 233
? – Joseph D.