- Making Columns
- Built-in searching
- Built-in sorting
- Built-in cell formatting
- Conditional columns
- User column selection
- Secondary Header Functionality
- Footer Functionality
- Misc. Functionality
Getting Started
Usage
Columns
The Query
Row
Bulk Actions
Filters
Customizing
Display
🎉 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 on the left/at the top. Check your current version with the following command:
composer show rappasoft/laravel-livewire-tables
The search filter
Sometimes the default search behavior may not meet your requirements. If this is the case, skip using the searchable() method on columns and define your own behavior directly on the query.
1public function query(): Builder2{3 return User::query()4 ->when($this->getFilter('search'), fn ($query, $term) => $query->where('name', 'like', '%'.$term.'%')5 ->orWhere('email', 'like', '%'.$term.'%'));6}
You can make this even more streamlined by adding a search scope to your model like so:
1public function scopeSearch($query, $term)2{3 return $query->where(4 fn ($query) => $query->where('name', 'like', '%'.$term.'%')5 ->orWhere('email', 'like', '%'.$term.'%')6 );7}
And then using it like this:
1public function query(): Builder2{3 return User::query()4 ->when($this->getFilter('search'), fn ($query, $term) => $query->search($term));5}