@foreach($subcategories as $index => $subcategory) @if(count($subcategory->productsBySubcategory)>0)
{{$subcategory->name}} View all
@foreach($subcategory->productsBySubcategory->take(7) as $product)
@include('frontend.homepage.products')
@endforeach
@endif @endforeach