I want to check if my foreach is empty so the basic html markup isn\'t displayed with no results inside. I\'m trying to wrap it in an if statement and then if it is empty do not
Using following code, one can first check variable is set or not using @isset of laravel directive and then check that array is blank or not using @unless of laravel directive
@if(@isset($names))
@unless($names)
Array has no value
@else
Array has value
@foreach($names as $name)
{{$name}}
@endforeach
@endunless
@else
Not defined
@endif