@php $cards = $data['modal_cards'] ?? []; $chunks = collect($cards)->chunk(4); @endphp
@foreach ($chunks as $chunkIndex => $chunk) @php // Each card sits in a 25%-wide column (col-3). When a row has fewer // than 4 cards they get centered, so the green connector must shrink // to link only the first and last card centers of that row. $count = $chunk->count(); $inset = (4 - $count) * 12.5 + 12.5; @endphp
@if ($count > 1)
@endif
@foreach ($chunk as $card) @php $globalIndex = $chunkIndex * 4 + $loop->index; @endphp
@endforeach
@endforeach
@foreach ($cards as $cardIndex => $card) @endforeach