- 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
Events
Listened For
These are the available events on the datatable component that you can fire from your application, or client-side
refreshDatatable
1$this->dispatch('refreshDatatable');
Calls $refresh
on the component. Good for updating from external sources or as an alternative to polling.
setSort
You can have the table sort a specific column:
1$this->dispatch('setSort', 'name', 'asc');
clearSorts
You can clear all the applied sorts:
1$this->dispatch('clearSorts');
setFilter
You can have the table run a specific filter:
1$this->dispatch('setFilter', 'status', '1');
clearFilters
You can have the table clear all filters:
1$this->dispatch('clearFilters');
Dispatched
There are several events, all in the Rappasoft\LaravelLivewireTables\Events namespace
Event Name | Event Purpose | Data Passed |
---|---|---|
ColumnsSelected | Applied whenever a Column is selected/deselected from view | The Table Name ($tableName), Selected Columns ($value), Logged In User ($user) |
FilterApplied | Applied when a Filter is applied (not when removed) | The Table Name ($tableName), Filter Key ($key), Filter Value ($value), Logged In User ($user) |
SearchApplied | Applied when a Search is applied (not when removed) | The Table Name ($tableName), Search Term ($value), Logged In User ($user) |
Passing the user with an event is optional and can be disabled in the config.
By default, the Tables will dispatch an event when the Selected Columns is changed, you may customise this behaviour:
enableAllEvents
This enables all Dispatched Events. This should be used with caution, as more events will be introduced in the future.
1public function configure(): void2{3 $this->enableAllEvents();4}
disableAllEvents
This disables all Dispatched Events.
1public function configure(): void2{3 $this->disableAllEvents();4}
enableColumnSelectEvent
Enables the Column Select Event, has no impact on other events
1public function configure(): void2{3 $this->enableColumnSelectEvent();4}
disableColumnSelectEvent
Disables the Column Select Event, has no impact on other events
1public function configure(): void2{3 $this->disableColumnSelectEvent();4}
enableSearchAppliedEvent
Enables the Search Applied Event, has no impact on other events
1public function configure(): void2{3 $this->enableSearchAppliedEvent();4}
disableSearchAppliedEvent
Disables the Search Applied Event, has no impact on other events
1public function configure(): void2{3 $this->disableSearchAppliedEvent();4}
enableFilterAppliedEvent
Enables the Filter Applied Event, has no impact on other events
1public function configure(): void2{3 $this->enableFilterAppliedEvent();4}
disableFilterAppliedEvent
Disables the Filter Applied Event, has no impact on other events
1public function configure(): void2{3 $this->disableFilterAppliedEvent();4}