I have two routes as follow:
Route::GET('admins/', 'UserController@index')->middleware('jwt.auth');
Route::GET('visitors', 'UserController@indexVisitors')->middleware('jwt.auth');
And I have guards in auth.php:
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'api' => [
'driver' => 'jwt-auth',
'provider' => 'users',
],
'visitor_api' => [
'driver' => 'jwt-auth',
'provider' => 'visitors',
],
],
I tried to specify the guard in the middleware but it doesn't work.
Route::GET('visitors', 'UserController@indexVisitors')
->middleware('jwt.auth.visitors_api');