i have route api code like this
Route::group(['middleware' => 'auth:api','web'], function(){
Route::get('user', 'Api\AuthController@user');
Route::get('kurir', 'Api\AuthController@kurir');
Route::get('droppoint', 'Api\DroppointController@index');
Route::get('droppoint/{id}', 'Api\DroppointController@show');
Route::post('droppoint', 'Api\DroppointController@store');
Route::put('droppoint/{id}', 'Api\DroppointController@update');
Route::delete('droppoint/{id}', 'Api\DroppointController@destroy');
});
Route::group(['middleware' => 'auth:kurirs-api','web'], function(){
Route::get('user', 'Api\AuthController@user');
Route::get('kurir', 'Api\AuthController@kurir');
Route::get('droppoint', 'Api\DroppointController@index');
Route::get('droppoint/{id}', 'Api\DroppointController@show');
Route::post('droppoint', 'Api\DroppointController@store');
Route::put('droppoint/{id}', 'Api\DroppointController@update');
Route::delete('droppoint/{id}', 'Api\DroppointController@destroy');
});
I want to make login program with two role "user" and "kurir".
My question is why its just authorized the last one "kurirs-api", and if i access the first one its show unauthenticated? and if i change the position, it's only authorized "auth:api". What to do to make the code can authorize "api" and "kurirs-api"?
I have searching in the internet but the problem still doesnt solve