I have searched and found various results like these: auth()->user() is null in Laravel 5.2 and Auth::user() returns null
But, mine is still not working.
I had a similar problem. I was defining a custom Middleware for the API group and Auth was always appearing as null.
I fixed this by loading in the EncryptCookies
Middleware before my custom one.
'api' => [
\App\Http\Middleware\EncryptCookies::class,
\App\Http\Middleware\VerifyParametersMiddleware::class, // your custom middleware, load after EncryptCookies
'throttle:60,1',
'bindings',
],
This change can be made within Kernel.php
.