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