View::composer('layouts.main', function($view) { $view->with('name', Auth::check() ? Auth::user()->firstname : ''); });