Example Usage
SummariesTable.php
public function configure(): void
{
$this->setPrimaryKey('id')
->setFooterEnabled() // Enable footer row
->setUseHeaderAsFooterEnabled(); // Use header style
}
public function columns(): array
{
return [
Column::make('ID', 'id')
->footer(fn($rows) => 'Count: ' . $rows->count()),
Column::make('Success Rate', 'success_rate')
->footer(fn($rows) => 'Avg: ' . round($rows->avg('success_rate'), 1) . '%'),
Column::make('Sort Order', 'sort')
->footer(fn($rows) => 'Sum: ' . $rows->sum('sort')),
];
}
count()
Total rows
sum()
Add all values
avg()
Average value
min()
Lowest value
max()
Highest value
Live Demo
Look at the footer row to see calculated summary values (Count, Average, Sum)
You are not connected to the internet.
| 1 | Miss Eve Will | [email protected] | 97% | 1 | |
| 2 | Mr. Cornelius Hansen DDS | [email protected] | 17% | 2 | |
| 3 | Dr. Albertha Abbott | [email protected] | 70% | 3 | |
| 4 | Citlalli Berge PhD | [email protected] | 26% | 4 | |
| 5 | Mr. Austen Harber | [email protected] | 35% | 5 | |
| 6 | Raegan Pfannerstill PhD | [email protected] | 60% | 6 | |
| 7 | Dan Ebert | [email protected] | 21% | 7 | |
| 8 | Mertie Kohler | [email protected] | 56% | 8 | |
| 9 | Prof. Cornelius Herzog DDS | [email protected] | 41% | 9 | |
| 10 | Barbara Metz | [email protected] | 37% | 10 | |
| Count: 10 | Summary Row → | Avg: 46% | Sum: 55 |
Showing 1 to 10 of results