Checking for logged in user on a global middleware

Posted 1 year ago by lmartins

Hi everyone,

On my application I have two user models, one for regular users and another for admins, and I'm working on a feature that requires to run a global middleware for setting the app locale based of the user model.

The issue i'm facing is that when I try to check the current logged in user, I can get the Auth::guard('admin')->check() to work, as it always returns false, maybe because its running before the user's session is verified perhaps.

What am I missing here?

Thanks!

Please sign in or create an account to participate in this conversation.