@php $children = $allItems->where('parent_id', $item->id); @endphp @if($children->count() > 0) @endif