@foreach($billItems as $billItem)
@php
$product = $billItem->product;
$customer = $billItem->bill->customer;
$productJson = json_encode([
'id' => $product->id,
'name' => $product->name,
'company' => $product->company,
'unit_type' => $product->unit_type,
'salt' => $product->salt,
'stock' => $product->quantity,
'category' => is_array($product->categories) ? implode(', ', $product->categories) : $product->categories,
'bill_item_id' => $billItem->id,
'max_qty' => $billItem->qty
]);
@endphp
{{ $product->name }}
Company: {{ $product->company }}
Customer: {{ $billItem->bill->customer_name }}
Bill ID: {{ $billItem->bill_id }}
Qty Purchased: {{ $billItem->qty }}
@endforeach