在laravel中有着雄辩的关系

I am trying to fetch data for my invoice page wherein I used many appended rows against single invoice number. I fetched data but the problem is I can not show the appended rows in invoice view page. What should be written the query to get the expected result, Would someone help me, please? My database table is - order_proforma_invoices

And I am expecting like below what I did during crate- view page

In my controller, I tried something like this-

public function orderProformaInvoiceDetails($poi)
{

    $orderProformaInvoiceDetails = OrderProformaInvoice::where('opi_id', $poi)
                                        ->with('buyer', 'buyerJobs', 'buyerOrders')
                                        ->groupBy('invoice_no')
                                        ->orderBy('created_at', 'DESC')
                                        ->get();

    return view('admin.marchendaising.order-proforma-invoices.details', compact('orderProformaInvoiceDetails'));
}

You should group the query result:

OrderProformaInvoice::where('opi_id', $poi)
    ->with('buyer', 'buyerJobs', 'buyerOrders')
    ->orderBy('created_at', 'DESC')
    ->get()
    ->groupBy('invoice_no');

@foreach($orderProformaInvoiceDetails as $invoice_no => $details)
    @foreach($details as $detail)
        {{ $detail->quantity }}
    @endforeach
@endforeach