when I use auth api gaurd for logout route. I am facing with the following Exception
Auth guard [:api] is not defined
I have already implemented registration login Apis but I am facing this error with logout api which I had protected using auth::api
config.auth file
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'api' => [
'driver' => 'passport',
'provider' => 'users',
],
],
api.php
Route::group(['prefix'=>'auth'],function(){
Route::post('login','AuthController@login');
Route::post('signup','AuthController@signup');
Route::group(['middleware' => 'auth::api'], function () {
Route::get('logout','AuthController@logout');
Route::get('user','AuthController@user');
});
});
I should be able to logout the user
auth::api
is incorrect, remove one of the colonsauth:api
.