@php $colClass = match (true) { $itemsPerRow >= 6 => 'col-lg-2 col-md-3 col-4', $itemsPerRow == 5 => 'col-lg-2 col-md-3 col-4', $itemsPerRow == 4 => 'col-md-3 col-6', default => 'col-md-' . max(2, (int) (12 / $itemsPerRow)) . ' col-6', }; @endphp