@php $flat = []; foreach ($lines as $line) { for ($i = 0; $i < $line['cantidad']; $i++) { $flat[] = $line; } } $chunks = array_chunk($flat, 10); @endphp @foreach ($chunks as $chunk) @php $chunk = array_values($chunk); while (count($chunk) < 10) { $chunk[] = null; } @endphp @for ($row = 0; $row < 5; $row++) @for ($col = 0; $col < 2; $col++) @php $idx = $row * 2 + $col; $line = $chunk[$idx]; @endphp @endfor @endfor
@if ($line) @php $pm = trim((string) ($line['pmRegistro'] ?? '')); @endphp

IMPORTADOR:

{{ $importador }}

{{ $direccion }}

{{ $line['articleName'] }}

{{ $line['articleCode'] }}

APROBADO POR LA ANMAT

PRODUCTO MEDICO

@if ($pm !== '')

{{ $pm }}

@endif

DIRECTOR TECNICO: {{ $directorTecnico }}

@else
 
@endif
@endforeach