- 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
- Increment Column (beta)
- Link Columns
- Livewire Component (beta)
- Sum Columns (beta)
- View Component Columns
- Wire Link Column (beta)
- Introduction
- Creating Filters
- Applying Filters
- Available Methods
- Available Component Methods
- Available Filter Methods
- Filter Pills
- 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)
- Livewire Custom Array 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
Livewire Custom Array Filter (Beta)
IN BETA This feature is currently in beta, and use in production is not recommended.
Usage
This allows you to use a child/nested Livewire Component in place of the existing Filters, giving you more control over the look/feel/behaviour of a filter. This version supports use of returning an array of values for use in filtering.
To use a LivewireComponentArrayFilter, you must include it in your namespace:
1use Rappasoft\LaravelLivewireTables\Views\Filters\LivewireComponentArrayFilter;
When creating a filter:
- Specify a unique name
- Set the path to a valid Livewire Component
- Define a filter() callback to define how the returned value will be used.
1public function filters(): array 2{ 3 return [ 4 LivewireComponentArrayFilter::make('My External Filter') 5 ->setLivewireComponent('my-test-external-filter') 6 ->filter(function (Builder $builder, array $values) { 7 $builder->whereIn('foreign_id', $values); 8 }), 9 ];10}
setPillsSeparator
As this is an array, you can define the separator to use between pills values, by default this is set to ", "
1public function filters(): array 2{ 3 return [ 4 LivewireComponentArrayFilter::make('My External Filter') 5 ->setLivewireComponent('my-test-external-filter') 6 ->setPillsSeparator(' OR ') 7 ->filter(function (Builder $builder, array $values) { 8 $builder->whereIn('foreign_id', $values); 9 }),10 ];11}