Answer the question
In order to leave comments, you need to log in
Laravel passport route without middleware, how to get authorized user?
I want to create an API for my application but I have a problem with the route.
I have the ability to add a link and I have a condition: if the user is authorized, the user's id is written, if not authorized, his u_id is written.
All this is sent to the same router, but here's the problem:
Route:: post('/link-store', ['as' = > 'api.link', 'uses' = > 'Api\[email protected]']);
dd(\Auth()->user())
middleware('auth:api')->group( function () { Route::post('/link-store', ['as' => 'api.link', 'uses' => 'Api\[email protected]']); });
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question