Laravel 5, View::Share

前端 未结 5 833
闹比i
闹比i 2021-01-02 14:27

I\'m trying to do a view::share(\'current_user\', Auth::User()); but in laravel 5 i can\'t find where to do this, in L4 you could do this in the baseController,

5条回答
  •  误落风尘
    2021-01-02 14:44

    I'v tried it, put it in app/Providers simply not working. The alternative way is to create a Global middleware and put View::share('currentUser', Auth::user()); there.

提交回复
热议问题