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 -
And I am expecting like below what I did during crate-
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'));
}