How to check in a Laravel blade if a user is authenticated or a guest

Use the following blade directive to see if a Laravel user is authenticated:

@auth
   // The user is authenticated...
@endauth

To see if it’s a guest login:

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

Reference:
https://stackoverflow.com/questions/29333291/laravel-5-change-navbar-if-user-is-logged

Tags

Share this article

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top