Laravel 5: Change navbar if user is logged

后端 未结 6 567
盖世英雄少女心
盖世英雄少女心 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:32

    If you are using Laravel 5's built in User model you can simply do

    @if (Auth::check())
      //show logged in navbar
    @else
      //show logged out navbar
    @endif
    

提交回复
热议问题