Using if and else statements is required to make your view more dynamic.
You may construct if statements using the @if, @elseif, @else, and @endif built-in functions. These built-in functions function identically to their PHP counterparts.
@if (count($records) === 1)
I have one record!
@elseif (count($records) > 1)
I have multiple records!
@else
I don't have any records!
@endif
Instead of writing an if statement which will check if something is defined or empty, you can use the short-hand methods @isset, @empty, @notisset and @notempty as convenient shortcuts:
@isset($foo)
// $foo is defined and is not null
@endisset
@notisset($foo)
// $foo is not defined
@endnotisset
@empty($foo)
// $foo is "empty"
@endempty
@notempty($foo)
// $foo is not "empty"
@endnotempty