@php $cardsPerPage = $rows * $cols; $pages = array_chunk($posts, $cardsPerPage); @endphp @foreach($pages as $pageIndex => $pagePosts) @php $padded = array_pad($pagePosts, $cardsPerPage, null); $isLast = $pageIndex === count($pages) - 1; @endphp @for($row = 0; $row < $rows; $row++) @for($col = 0; $col < $cols; $col++) @php $idx = $row * $cols + $col; $data = $padded[$idx] ?? null; @endphp @endfor @endfor
@if($data) @include('posts._pdf-card-bw', array_merge($data, [ 'scale' => $scale, 'cardW' => $cardW, 'cardH' => $cardH, 'margin' => $margin, 'logoTop' => $logoTop, 'logoRight' => $logoRight, 'logoW' => $logoW, 'logoH' => $logoH, 'titleMarginTop' => $titleMarginTop, 'cardTitleMaxPt' => $titleFontMaxPt, 'cardTitleContainerMm' => $titleContainerMm, 'catFont' => $catFont, 'catPadH' => $catPadH, 'catPadV' => $catPadV, 'excerptFont' => $excerptFont, 'excerptMT' => $excerptMT, 'excerptMaxH' => $excerptMaxH, 'bottomBottom' => $bottomBottom, 'qrSize' => $qrSize, 'qrCellW' => $qrCellW, 'qrCellPad' => $qrCellPad, 'venueFont' => $venueFont, 'dateFont' => $dateFont, 'footerFont' => $footerFont, 'footerMT' => $footerMT, ])) @endif
@endforeach