@foreach ($data as $value) @php if(isset($categoryActive)){ $active =collect($categoryActive); }else{ $active=collect(); } // $listIdChildren = $modelCategory->getALlCategoryChildrenAndSelf($value->id); // $listItem=$modelCategory->select(['id'])->whereIn('id',$listIdChildren)->get(); // $listItemSlugFull = $listItem->map(function ($item, $key) { // return $item->slug_full; // }); // dd($listItemSlugFull->contains($urlActive)); @endphp
  • {{ $value->name }} ({{ $value->count_product }}) @if ($value->childs->count()) @endif @if ($value->childs->count())
      contains($value->id)) style="display:block" @endif> @foreach ($value->setAppends(['count_product'])->childs()->orderby('order')->orderByDesc('created_at')->get() as $childValue) @include('frontend.components.category-product-child', ['childs' => $childValue]) @endforeach
    @endif
  • @endforeach