I have the following route in my routes/api.php
Route::get('/games/{game}', 'GamesController@show')->name('api.games.show');
On client side, I already included Authorization bearer token header in every AJAX request.
How can I retrieve the value of the user associated with the token throught $request->user()
without having to require authentication (without having to use ->middleware('auth:api')
)
Basically what I want is to have one route that serves for both authenticated (with token) and non authenticated (without token) requests.