1View::composer('*', function($view)
2{
3 $view->with('name', Auth::check() ? Auth::user()->firstname : '');
4});
5
1require app_path().'/composers.php';
2You can even create a file for this purpose, something like app/composers.php and load it in your app/start/global.php:
1View::composer('layouts.main', function($view)
2{
3 $view->with('name', Auth::check() ? Auth::user()->firstname : '');
4});
5