- Creating Columns
- Relationships
- Available Methods
- Other Column Types
- Column Selection
- Secondary Header
- Footer
- Reusable Columns
- Anonymous Columns
- Styling
- Standard Column
- Array Columns (beta)
- Avg Columns (beta)
- Boolean Columns
- Button Group Columns
- Color Columns
- Component Columns
- Count Columns (beta)
- Date Columns
- Icon Columns (beta)
- Image Columns
- Link Columns
- Livewire Component (beta)
- Sum Columns (beta)
- View Component Columns
- Wire Link Column (beta)
- Introduction
- Boolean Filters (beta)
- Date Filters
- DateRange Filters
- DateTime Filters
- Multi-Select Dropdown Filters
- Multi-Select Filters
- NumberRange Filters
- Number Filters
- Select Filters
- Text Filters
- Livewire Custom Filter (Beta)
- Refreshing
- Loading Placeholder
- Multiple Tables Same Page
- Actions (beta)
- Adding Custom Markup
- Debugging
- Saving Table State
- Lifecycle Hooks
- Hiding The Table (beta)
- One Of Many Example
- Tools
Getting Started
Usage
DataTable
Columns
Column Types
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
Lifecycle Hooks
With the migration to Livewire 3, there we are implementing several Lifecycle Hooks to assist with re-using methods across multiple Table Components.
You may use these either in your Table Component, or in a trait
configuring
This is called immediately prior to the configure() method being called. This will be overridden by anything you define in configure()
configured
This is called immediately after the configure() method is called. This will override anything you define in configure()
settingColumns
This is called prior to setting up the available Columns via the columns() method
columnsSet
This is called immediately after the Columns are set up
configuringColumnSelect
This is called immediately prior to setting up Column Select
configuredColumnSelect
This is called immediately after setting up Column Select
rowsRetrieved
This is called immediately after the query is executed, and is passed the result from the executed query.
searchUpdated
This is called whenever the search is updated, and is passed the value that has been searched for
filterApplying
This is called whenever a Filter is applying
filterReset
This is called whenever a Filter is reset
filterSet
This is called whenever a Filter is set
filterUpdated
This is called whenever a Filter is updated/used
filterRemoved
This is called whenever a Filter is removed from the table
Use in Traits
To use these in a trait, allowing you to easily set defaults across multiple tables, you should ensure that you append the Lifecycle Hook with your trait name, e.g.
You can then add the trait to your tables, allowing you to centralise your defaults, and avoid code duplication.
1trait StandardTableMethods 2{ 3 4 public function configuringStandardTableMethods() 5 { 6 // Your standard configure() options go here, anything set here will be over-ridden by the configure() method 7 // For Example 8 $this->setColumnSelectDisabled(); 9 }10 11 public function configuredStandardTableMethods()12 {13 // Your standard configure() options go here, anything set here will override those set in the configure() method14 // For Example15 $this->setColumnSelectDisabled();16 }17 18}