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

Resetting after bulk actions

If your bulk action is changing the outcome of your table, i.e. you are deleting rows or changing criteria that would alter the row set with the search criteria you have, then you may have unexpected results after the bulk action runs.

There is no one good way to handle this, so there are a few options available to you:

1. Reset all the filters and criteria.

You can reset all the filters, search, page, sorts, etc. With this method, that will essentially reload the table to what it was on the first page load with your bulk changes since the query will re-run:

1public function deleteSelected()
2{
3 // Delete the rows
4 
5 $this->resetAll();
6}

2. Reset specific criteria

You may at the end of your bulk action method reset specific parts of the UI with any of the following methods:

1public function myBulkAction()
2{
3 // Do something with the rows
4 
5 // Use any of these to reset the UI to a point that makes sense after your bulk action is run:
6 $this->resetFilters(); // Remove all the filters
7 $this->resetSearch(); // Remove the search query
8 $this->resetSorts(); // Remove the sorts
9 $this->resetBulk(); // Clear the selected rows
10 $this->resetPage($this->pageName()); // Go back to page 1
11}