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 sorting configuration methods on the component.


Sorting as a whole is enabled by default, but if you ever needed to toggle it you can use the following methods:

setSortingStatus

Enable/disable sorting for the whole component.

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

setSortingEnabled

Enable sorting for the whole component.

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

setSortingDisabled

Disable sorting for the whole component.

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

Single sorting is enabled by default, but if you ever needed to toggle it you can use the follow methods:

setSingleSortingStatus

Enable/disable single sorting for the whole component.

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

setSingleSortingEnabled

Enable single sorting for the whole component.

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

setSingleSortingDisabled

Disable single sorting for the whole component.

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

There is no default sort by default, but if you wanted to add one:

setDefaultSort

Set the default sorting column and direction.

1public function configure(): void
2{
3 $this->setDefaultSort('name', 'desc');
4}

If you had the need to programmatically remove the default sort:

removeDefaultSort

Remove the default sort.

1public function configure(): void
2{
3 $this->removeDefaultSort();
4}

Sorting pills are enabled by default, but if you ever needed to toggle it you can use the following methods:

setSortingPillsStatus

Enable/disable sorting pills for the whole component.

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

setSortingPillsEnabled

Enable sorting pills for the whole component.

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

setSortingPillsDisabled

Disable sorting pills for the whole component.

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

setDefaultSortingLabels

If you would like to set the default sorting labels for the sorting pills you may override them:

By default, they are A-Z for ascending and Z-A for descending.

1public function configure(): void
2{
3 $this->setDefaultSortingLabels('Asc', 'Desc');
4}