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