Posted: 03-09-2017

Blade New @auth and @guest Directives

Blade New @auth and @guest Directives

Recently I've updated maguttiCms using  two new useful Blade directives part of Laravel 5.5 5.5: @auth and @guest.
These new shortcuts permit  to quickly determine if the current user is authenticated or is a guest: 

@guest
guest stuff here
@else
logged user stuff here
@endauth

or

@auth
   logged user stuff here
@endauth

or if you're using a Guard

 @auth('admin')
    logged in through admin guard
@endauth


Learning More About Laravel new Blade directives

What's New in Laravel 5.5: New Blade Directives