I am using Laravel 5.0.28, view::share('current_user', Auth::User()) no longer works because this problem is https://github.com/laravel/framework/issues/6130
Instead, I create a new service provider using the wizard instead.
php artisan make:provider ComposerServiceProvider
Then add ComposerServiceProvider to the config/app.php providers
Then open the app/Providers/ComposerServiceProvider.php that has just been created, add the following inside the boot method
public function boot() { View::composer('*', function($view) { $view->with('current_user', Auth::user()); }); }
Finally, import View and Auth facade
use Auth, View;
For more information see http://laravel.com/docs/5.0/views#view-composers
source share