Get authenticated user with Laravel Passport and grant password
I did an API REST with Laravel and now I'm trying to consume it. The thing is I need to authenticate users in the API and I am using the Password Grant method. I can authenticate users correctly and I can get an access token but from then, I don't see a way to retrieve the authenticated user with the access token in my consuming application. I tried in the API with a route like this: Route::get('/user', function(Request $request) { $user = $request->user(); // Even with $user = Auth::user(); return $user; }); No dice. I am reading Passport code but I can't figure it out. My guess is that I