Jan 18, 2021
0
Level 3
is it possible to get the user in api without using passport using laravel default auth
I have an application which is monolithic. Now I want to get the authenticated user in just like 2 apis in my application. I know that I can use laravel passport to generate tokens and get the user but I want to know if it's possible to get the authenticated user on website in api too.
Now in my api controller when I dd() below options I get null:
dd(auth()->user());
dd(auth('api')->user());
dd(Auth::user());
I am using laravel fortify for user login.
Please or to participate in this conversation.