Laravel Livewire Tables Documentation

🎉 Enjoying this package? Consider sponsoring me on GitHub or buying me a beer.

This is the documentation for v1 but the latest version is v3. You can switch versions in the menu at the top. Check your current version with the following command:

composer show rappasoft/laravel-livewire-tables

Footer Functionality

The following footer methods are only available in v1.16 and above

You have 2 options when it comes to footer rows:

1. Use the header as the footer

1public bool $useHeaderAsFooter = true;

This literally duplicates the header, including bulk selection, sorting, etc.

2. Customize the footer cell for each column

You can pass a footer method to each column which will be passed all the rows that are on that page.

1Column::make('Sales')
2 ->sortable()
3 ->footer(fn($rows) => 'Total: ' . $rows->sum('sales')),
1Column::make('Sales')
2 ->sortable()
3 ->asHtml()
4 ->footer(fn($rows) => '<strong>Total:</strong> ' . $rows->sum('sales')),
1Column::make('Sales')
2 ->sortable()
3 ->footer(fn($rows) => view('includes.cells.sales')->withRows($rows)),

Calling footer on any column will enable the custom footer, any column without a footer method will just contain a blank cell.

See also, row and cell customization.

Note: the asHtml() column method is used for both the data and the secondary header/footer cells.