api.php routes are returning 401 error.
I have properly installed and set-up the package. All my routes under web.php file are working perfectly fine, but for api.php all routes are showing unauthenticated message for middleware auth:api. I upgraded my laravl from v10 to v11. I have used this package in other projects as well in the same manner as I am using in this one but I don't know why I am getting these errors.
Your environment
Q
A
Bug?
yes
New Feature?
no
Framework
Laravel
Framework version
^11
Package version
^2
PHP version
8.3
Steps to reproduce
Install the package for the same environment as mentioned above and follow step by step installation given in the docs. Make request to both web.php and api.php routes to fetch auth()->user().
api.php routes are returning 401 error. I have properly installed and set-up the package. All my routes under web.php file are working perfectly fine, but for api.php all routes are showing unauthenticated message for middleware
auth:api
. I upgraded my laravl from v10 to v11. I have used this package in other projects as well in the same manner as I am using in this one but I don't know why I am getting these errors.Your environment
Steps to reproduce
Install the package for the same environment as mentioned above and follow step by step installation given in the docs. Make request to both web.php and api.php routes to fetch auth()->user().
Expected behaviour
auth()->user() should be returned in both cases.
Actual behaviour
Getting auth()->user() only in web.php routes