Access to current user session from a Livewire component

If I call \Auth::getUser() the first time it works fine but on the next requests it returns null.

I tried in hydrate(), mount() and directly in render().

The only way I could make it work is to keep it on a property but that seems a bit counter intuitive, what if he session has expired or the model changes in the meantime?

Any ideas?

Auth should be available on all requests, so I’m thinking you have a larger issue somewhere.

$this->authorize() works fine and it has access to the current user session. Auth::check() also seems to work fine but Auth::getUser() doesn’t.

Does Auth::user() and Auth::id() work?

Thanks! auth()->user() seems to work.