fbpx
  • Win a Fitbit Inspire HR when you move your hosting to us. Competition ends 30 November 2019

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

Share this article

Share on facebook
Share on twitter
Share on linkedin

Leave a Reply

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

Scroll to Top