Laravel 5: Change navbar if user is logged

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

    New versions of Laravel (5.6 at time of writing) support these two directives in Blade:

    @auth
    // The user is authenticated...
    @endauth
    
    @guest
    // The user is not authenticated...
    @endguest
    

    See official documentation here: https://laravel.com/docs/5.6/blade

提交回复
热议问题