@foreach (collect($barcodes)->groupBy('number') as $number => $items) @php $barcode = $items->first(); // Ambil data 1 barcode untuk info (name, price, barcode image) @endphp

Barcode: {{ $barcode['name'] }} - Rp. {{ number_format($barcode['price'], 0, ',', '.') }}

@for ($i = 0; $i < 45; $i++) @if ($i % 5 == 0) @endif @if (($i + 1) % 5 == 0) @endif @endfor

{{ $barcode['name'] }}
Rp. {{ number_format($barcode['price'], 0, ',', '.') }}

{{ $barcode['number'] }}
{{ $barcode['number'] }}
@endforeach