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 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 reordering.


setReorderStatus

Disabled by default, enable/disable reordering for the component.

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

setReorderEnabled

Enable reordering on the component.

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

setReorderDisabled

Disable reordering on the component.

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

setCurrentlyReorderingStatus

Disabled by default, start/stop reordering for the component.

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

setCurrentlyReorderingEnabled

Start reordering for the component. (Handled by the reorder button, but if you wanted to start reordering without the button, you can call this method.)

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

setCurrentlyReorderingDisabled

Stop reordering for the component. (Handled by the reorder button, but if you wanted to stop reordering without the button, you can call this method.)

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

setHideReorderColumnUnlessReorderingStatus

Disabled by default. If your reorder column is part of your table definition, then show/hide it.

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

setHideReorderColumnUnlessReorderingEnabled

Hide the reorder column from the table unless reordering.

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

setHideReorderColumnUnlessReorderingDisabled

Don't hide the reorder column from the table.

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

setReorderMethod

Set the method that will be called when the "Save" button is clicked. (Default is reorder.)

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

setDefaultReorderSort

Set the default sort the table will use when reordering. (Default is sort and asc.)

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

setReorderThAttributes

You may pass an array to this method, which allows you to pass Custom Attributes into the table header for the Reorder Column

1public function configure(): void
2{
3 
4 $this->setReorderThAttributes([
5 'class' => 'bg-red-500',
6 'default' => false
7 ]);
8}