vendredi 2 juin 2017

Logout : MethodNotAllowedHttpException in RouteCollection.php line 233

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 method in the view

 <a href="" class="btn btn-default btn-flat"
               onclick="event.preventDefault();
                                             document.getElementById('logout-form').submit();">
              Logout
            </a>

            <form id="logout-form" action="" method="POST" style="display: none;">
              
            </form>

the function work fine but when i click the button i get this error : MethodNotAllowedHttpException in RouteCollection.php line 233



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2sz9TYa
via IFTTT

Aucun commentaire:

Enregistrer un commentaire