Laravel @auth Directive

This directive is a directive you can use to show special content to logging in. To check if it is logged in under normal conditions, we check using the @if directive like this.

@if(auth()->user())
    // the user is logged in, we can show what we want
@endif

But Blade gives us a directive called @auth. That's exactly what works and you're writing cleaner code.

@auth
    // the user is logged in, we can show what we want
@endauth

good work.

Comments

There are no comments, make the firs comment