@php $contadorCols = 0; $rowNumber = 0; $page = 1; $oldPage = 1; @endphp @foreach($saleProducts as $index => $saleProduct) @php $saleProduct->checkCorrelative(); @endphp @php if($contadorCols == 1){ $contadorCols = 0; $rowNumber++; if($rowNumber === 5){ $rowNumber = 0; $page += 1; echo '
   
{{ $saleProduct->cupon_code }}
N°{{ $saleProduct->correlative }}
'; }else{ echo ''; } }else{ $contadorCols ++; } @endphp @endforeach