- Creating Columns
- Relationships
- Available Methods
- Other Column Types
- Column Selection
- Secondary Header
- Footer
Getting Started
Usage
DataTable
Columns
Rows
Sorting
Pagination
Search
Bulk Actions
Filters
Reordering
Secondary Header
Footer
Examples
Misc.
Sponsored
Advanced Usage
Examples
🎉 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 on the left/at the top. Check your current version with the following command:
composer show rappasoft/laravel-livewire-tables
Processing Bulk Actions
To process your bulk action you must have a method on the component with the same name as the key in the bulk actions array:
1public array $bulkActions = [2 'exportSelected' => 'Export',3];4 5public function exportSelected()6{7 8}
You have access to the selectedKeys
method to grab the IDs of the rows that were selected:
1public function exportSelected()2{3 foreach($this->getSelected() as $item)4 {5 // These are strings since they came from an HTML element6 }7}
Resetting
After you process your action you'll probably want to reset the screen back to normal, for this you can call the clearSelected
method at the end:
1public function exportSelected()2{3 ...4 5 $this->clearSelected();6}