Nicholas Kajoh Nicholas Kajoh - 1 year ago 102
PHP Question

How do I make a logged in user object available to all views in Laravel 5.3

I want to be able to get a logged in user's details in my views. E.g

{{ $user->email }}

Here's my

public $view_data = array();

public function __construct()
$this->view_data['user'] = Auth::user();

in my views return
. Am I missing something?

Answer Source

It is already available in all views by default via:

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download