feat: add headerFilter() to table columns for inline filter components#19432
Open
leek wants to merge 2 commits intofilamentphp:4.xfrom
Open
feat: add headerFilter() to table columns for inline filter components#19432leek wants to merge 2 commits intofilamentphp:4.xfrom
headerFilter() to table columns for inline filter components#19432leek wants to merge 2 commits intofilamentphp:4.xfrom
Conversation
Allows attaching any BaseFilter subclass (SelectFilter, Filter with custom schema, etc.) to a table column via `->headerFilter()`. The filter renders inline under the column header as a richer alternative to `searchable(isIndividual: true)`. - Separate Livewire state ($tableHeaderFilters) and form, isolated from panel filters - Always live (ignores deferFilters()) - Auto-hidden labels, dense gap for multi-field schemas - Supports indicators, reset, session persistence, records() sources - Fully backwards-compatible Fixes filamentphp#18108, filamentphp#15714, filamentphp#8879, filamentphp#6842
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new
headerFilter()method to table columns, allowing anyBaseFiltersubclass to render inline under the column header. This provides a richer alternative tosearchable(isIndividual: true)— instead of a plain text search input, users can attach select dropdowns, date pickers, custom multi-field schemas, and more directly to column headers.Examples
Design
$tableHeaderFilters) and form (tableHeaderFiltersForm) — fully isolated from panel filtersdeferFilters()->columns()for side-by-side layout with dense gapsearchable(isIndividual: true)is unchangedrecords()data sourcesFixes
Fixes #18108
Fixes #15714
Fixes #8879
Fixes #6842
Test Plan
SelectFilterrenders a select under the header and filters records by exact matchFilterschema renders inline and applies the custom querysearchable(isIndividual: true)still works unchangedresetTableFiltersForm()resets header filters->hidden()) don't render in the header rowrecords()tables receiveheaderFiltersin the callback