Home > OS >  How to get currently logged in user email from controller
How to get currently logged in user email from controller

Time:09-23

I am trying to get the email of the currently logged in user from one of my controller. I normally get the currently logged in user id from this = auth()->id()
But when I try to get the email the same way like this = auth()->email() it gives me an error. Is there something I did wrong ? How can I get the email of the currently logged in user from my controller?

CodePudding user response:

just try auth()->user()->email

  • Related