0
I have an application where I have two authenticated user types (common and administrator). I have a route where I pass the id of the state and return me a json with the cities of that state. It turns out that I would like to keep this route available only for logged in users but for both types.
Route::get('{id}/cities', 'ApiControllers\StateController@cities')
->middleware('auth:admin', 'auth', 'verified')->name('cities');
I left my route file like this. When I access with an ordinary user, I am directed to the admins login screen. How do I make it accessible by any logged-in user (regardless of type)?
Hello @capaci, thanks for the answer but that’s not exactly what I asked. Maybe I wasn’t clear in my question. I would like to know how a route protected by authentication (login) can be accessed by users authenticated by different Guards. I’ll change my question and be more specific.
– Marcel
I ended up solving just creating another route using the same stretch and changing the Guards in each. Sorry to take your time with such a childish question.
– Marcel
Imagine, man. No question is childish. I don’t know the best way, but if you solved your problem, shoot ;)
– capaci