Home > OS >  Checking greater than or equal
Checking greater than or equal

Time:11-14

I need to check if the displayed number is greater than or equal to 1, or not equal to 0, then we display it

I am trying to do this but I get the error

<span class="comments">
@if({{ $allArticleCommentsCount }} >= 1) {{ $allArticleCommentsCount }} @endif Comments
</span>

syntax error, unexpected '<'

CodePudding user response:

Remove the blade syntax in your if statement and you're good to go.

@if($allArticleCommentsCount >= 1) {{ $allArticleCommentsCount }} @endif Comments
  • Related