@foreach ($data['category'] as $childCategory) @if ($category->id == $childCategory->parent_id) @endif @endforeach