jcmargentina's avatar

Test API route to retrive user (the default one) - not working

I might be doing something wrong or maybe I am confused.

I am trying to delcare an API rote in routes/api.php, but first of all I tried to test the default one

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});

but whenever I call it (/api/user) ... I get nothing from it.

what about this ? How can I make it work? How can I write a route and return the logged user ?

0 likes
1 reply

Please or to participate in this conversation.