Laravel @if Directive

We do the if-elseif-else operations that we use to take action according to the condition with these directives in the blade. For example;

@if (count($comments) === 1)
    1 comments
@elseif (count($comments) > 1)
    {{ $comments }} comment
@else
    no comment
@endif

 

Comments

There are no comments, make the firs comment