Instead user @if and @endif statement to check logged in user, you can use @auth directive.

Usual way

@if(auth()->user())
    // The user is authenticated.
@endif

using @auth

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

Chiwetara Igwe

I'm a full-stack developer, entrepreneur and owner of techbly.ng. I live in Nigeria and I love to write tutorials and tips that can help to other web developers. I am experienced in PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap. I am passionate about learning new things and keeping up with the latest trends and technologies.

http://techbly.ng

Leave a Reply

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

× Have a question?