Laravel 5: Change navbar if user is logged

后端 未结 6 444
盖世英雄少女心
盖世英雄少女心 2021-02-03 18:57

I\'m completely new to Laravel, MVC and templating engines in general.

I need to show certain navbar buttons and options if a user is logged in such as: Notifications, L

6条回答
  •  独厮守ぢ
    2021-02-03 19:26

    Starting from Laravel 5.4 there's new blade directive @includeWhen which includes view based on a given boolean condition :

    @includeWhen(Auth::check(), 'partials.navbarlogged')
    @includeWhen(Auth::guest(), 'partials.navbar')
    

提交回复
热议问题