@php $items_collection = $tab_spec->items()->where('category_id', $sub_category->id)
->where("is_active",1)->get(); @endphp
@php
$class = "col-md-3";
$chunkSize = 4;
@endphp
@php $maxTextRows = intval(round(\IHouse::getMaxTitleLengthOfItems($items_collection) / 18)); @endphp
@if(($items_collection->count() % 4) == 1)
@php
$chunkSize = 3;
@endphp
@endif
@foreach($items_collection->chunk($chunkSize) as $collection)
@foreach($collection as $item)
@php $item = $item->updateDiscount($item, $sub_category); @endphp
@include("components.item",compact('item', 'maxTextRows'))
@endforeach
@endforeach