Table Column Summary using Quantity

I have the following table column and 'Sum' working in the attached screenshot.

My code for this is as follows:
Tables\Columns\TextColumn::make('price')
    ->money()
    ->summarize(Sum::make()->money()->label('Total Price')),


My problem is that the sum doesn't take into each row's quantity.

How can I make the sum take each row's quantity into account?

For example, I need to mulitply each row's price * it's quantity then sum all of those.

Thanks for any insight into this!
image.png
Was this page helpful?