I have the following code that shows the output of a search for users, groups and posts :
<header><h1>Users results</h1></header>
@foreach ($users as $user)
@include('user.userblock')
@endforeach
<header><h1>Groups results</h1></header>
@foreach ($groups as $group)
@include('group.gruopblock')
@endforeach
<header><h1>Posts results</h1></header>
@foreach ($posts as $post)
@include('post.postblock')
@endforeach
How can I hide the <header>
if one of them doesn't have results ?