- Creating Columns
- Relationships
- Available Methods
- Other Column Types
- Column Selection
- Secondary Header
- Footer
- Reusable Columns
- Anonymous Columns
- Introduction
- Date Filters
- DateRange Filters
- DateTime Filters
- Multi-Select Dropdown Filters
- Multi-Select Filters
- NumberRange Filters
- Number Filters
- Select Filters
- Text Filters
- Refreshing
- Loading Placeholder
- Multiple Tables Same Page
- Adding Custom Markup
- Debugging
- Saving Table State
- Lifecycle Hooks
Getting Started
Usage
DataTable
Columns
Rows
Sorting
Pagination
Search
Bulk Actions
Filters
Filter Types
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 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
Clickable Rows
To enable clickable rows on your table, you may add the following to the table component configuration:
1public function configure(): void 2{ 3 $this->setPrimaryKey('id') 4 ->setTableRowUrl(function($row) { 5 return route('admin.users.show', $row); 6 }) 7 ->setTableRowUrlTarget(function($row) { 8 if ($row->isExternal()) { 9 return '_blank';10 }11 12 return '_self';13 });14}
If you would like to make a certain cell unclickable (i.e. if you have something else clickable in that cell), you may do so by adding the following to the column configuration:
1Column::make('Name')2 ->unclickable(),
Note: LinkColumns are not clickable by default to preserve the intended behavior of the link.
Using wire:navigate
To use wire:navigate, you should return "navigate" as the target for setTableRowUrlTarget
1public function configure(): void 2{ 3 $this->setPrimaryKey('id') 4 ->setTableRowUrl(function($row) { 5 return route('admin.users.show', $row); 6 }) 7 ->setTableRowUrlTarget(function($row) { 8 if ($row->isExternal()) { 9 return '_blank';10 }11 12 return 'navigate';13 });14}