Reputation: 145
I am new to laravel, Please bear with me How would I pass the current logged on user from the controller to the view?
Upvotes: 0
Views: 41
Reputation: 10254
You don't need to pass it to the view.
Using the Auth
facade, or auth()
helper you have access to the current user:
// Use the Auth facade
{{ Auth::user()->email }}
// Or use the Auth helper:
{{ auth()->user()->email }}
Upvotes: 2