How to show in a column from table sum from relationship
I have this:
But every orderItem has a column with amount.
I need to multiply the quantity by its price and in turn make the total sum. How could I do it?
Tables\Columns\TextColumn::make('order_items_sum_price')
->sum('orderItems', 'price')->money('eur')->sortable()->label('Precio Total')
But every orderItem has a column with amount.
I need to multiply the quantity by its price and in turn make the total sum. How could I do it?