File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -155,6 +155,48 @@ class OrdersTable extends Component
155155}
156156```
157157
158+ ### Column Aggregates
159+
160+ Columns support aggregate calculations that display in the table footer.
161+
162+ #### Summable Columns
163+
164+ Add ` .summable() ` to display column totals:
165+
166+ ``` php
167+ Column::add('total', 'Total')
168+ ->summable(),
169+
170+ Column::add('quantity', 'Quantity')
171+ ->summable(),
172+ ```
173+
174+ #### Averageable Columns
175+
176+ Add ` .averageable() ` to display column averages:
177+
178+ ``` php
179+ Column::add('rating', 'Rating')
180+ ->averageable(),
181+
182+ Column::add('price', 'Price')
183+ ->averageable(),
184+ ```
185+
186+ #### Combined Aggregates
187+
188+ Columns can display both sum and average:
189+
190+ ``` php
191+ Column::add('amount', 'Amount')
192+ ->summable()
193+ ->averageable(),
194+ ```
195+
196+ When both aggregates are present, they display as:
197+ - ** Sum: 1,500.00**
198+ - ** Avg: 150.00**
199+
158200### Column Filters.
159201
160202Filters allow you to filter data displayed in the grid.
You can’t perform that action at this time.
0 commit comments