skip to Main Content

Laravel eloquent GROUP BY

I have four tables: supplies, stocks, stock_ins, and stock_outs. In the Stock controller, I want to sum the total stock_out for each supply . For this, I have used the following query: $supplies = Stock::select( 'supplies.name', 'stocks.supply_id', 'stocks.id', 'stocks.stock', 'stock_ins.quantity…

VIEW QUESTION
Back To Top
Search