I'm currently available for full time hire! Inquire Here

Laravel Livewire Tables Documentation

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

This is the documentation for v2 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

Available Methods

These are the available configuration methods for the footer.


setFooterStatus

Enabled by default, enable/disable the footer for the component.

1public function configure(): void
2{
3 $this->setFooterStatus(true);
4 $this->setFooterStatus(false);
5}

setFooterEnabled

Enable the footer on the component.

1public function configure(): void
2{
3 // Shorthand for $this->setFooterStatus(true);
4 $this->setFooterEnabled();
5}

setFooterDisabled

Disable the footer on the component.

1public function configure(): void
2{
3 // Shorthand for $this->setFooterStatus(false);
4 $this->setFooterDisabled();
5}

setUseHeaderAsFooterStatus

Disabled by default, whether or not to use the secondary header as the footer.

1public function configure(): void
2{
3 $this->setUseHeaderAsFooterStatus(true);
4 $this->setUseHeaderAsFooterStatus(false);
5}

setUseHeaderAsFooterEnabled

Use the secondary header as the footer.

1public function configure(): void
2{
3 // Shorthand for $this->setUseHeaderAsFooterStatus(true);
4 $this->setUseHeaderAsFooterEnabled();
5}

setUseHeaderAsFooterDisabled

Use the footer as a stand-alone footer.

1public function configure(): void
2{
3 // Shorthand for $this->setUseHeaderAsFooterStatus(false);
4 $this->setUseHeaderAsFooterDisabled();
5}

setFooterTrAttributes

Set any attributes on the footer row element.

1public function configure(): void
2{
3 $this->setFooterTrAttributes(function($rows) {
4 return ['class' => 'bg-gray-100'];
5 });
6}

By default, this replaces the default classes on the tr element, if you would like to keep them, set the default flag to true.

1public function configure(): void
2{
3 $this->setFooterTrAttributes(function($rows) {
4 return [
5 'default' => true,
6 'class' => 'bg-gray-100'
7 ];
8 });
9}

setFooterTdAttributes

Set any attributes on the footer row cells.

1public function configure(): void
2{
3 $this->setFooterTdAttributes(function(Column $column, $rows) {
4 if ($column->isField('id')) {
5 return ['class' => 'text-red-500'];
6 }
7 });
8}

By default, this replaces the default classes on the td element, if you would like to keep them, set the default flag to true.

1public function configure(): void
2{
3 $this->setFooterTdAttributes(function(Column $column, $rows) {
4 if ($column->isField('id')) {
5 return [
6 'default' => true,
7 'class' => 'text-red-500'
8 ];
9 }
10 });
11}

See also footer column configuration.