Download the PHP package leek/filament-header-filters without Composer
On this page you can find all versions of the php package leek/filament-header-filters. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download leek/filament-header-filters
More information about leek/filament-header-filters
Files in leek/filament-header-filters
Package filament-header-filters
Short Description Inline header filter components for Filament tables — attach any BaseFilter to a column header.
License MIT
Informations about the package filament-header-filters
Filament Header Filters
Inline header filters for Filament tables. Attach any BaseFilter to a column header — select dropdowns, date pickers, min/max ranges, custom multi-field schemas — as a richer alternative to searchable(isIndividual: true).
Screenshot
Requirements
- PHP 8.2+
- Filament v4.x or v5.x
Installation
Add the HasHeaderFilters trait to any Livewire component that uses InteractsWithTable (resource list pages, custom Livewire table components):
Styles
Add the package stylesheet to the panel theme configured with ->viteTheme(...). Place it after Filament's theme import so it can adjust the table and header filter styles:
Then rebuild your app assets:
If you are using Vite locally, restart or keep running:
Usage
Call ->headerFilter() on any column and pass a filter instance.
Dropdown filter
Use SelectFilter for exact-match column filtering. The default placeholder is "All".
Min/max range filter
Use a custom Filter with two TextInput fields and ->columns(2) for a side-by-side numeric range:
Date range filter
Use DatePicker fields for a two-date range:
Behavior
- Header filters share state with panel filters (
$tableFilters). Filter indicators, reset, and session persistence all work. - Header filters are always live — they apply immediately on change, regardless of
deferFilters(). - Field labels inside header filters are auto-hidden; the column header acts as the label.
- Hidden columns' header filters are not applied to the query.
Tips
Hide the filters button when only using header filters
If a table has only header filters and no panel filters, hide the filters dropdown so the button doesn't render empty:
Filacheck false positive
Filacheck's missing-table-filters rule doesn't recognize ->headerFilter() and will flag tables that only use header filters. Publish the config and disable the rule:
How it works
The package ships:
Column::macro('headerFilter', ...),getHeaderFilter(),hasHeaderFilter()BaseFilter::macro('columnName', ...),getColumnName(),isHeaderFilter()Table::macro('getHeaderFilters', ...),hasHeaderFilters()- A
HasHeaderFiltersLivewire trait that wires filters into the table, seeds header filter state, and exposesgetTableHeaderFiltersForm() - A view override (
filament-tables::index) that renders the header filter row under the column search row - A small CSS file raising the z-index and lifting overflow clipping so dropdown / date picker popups escape the table container
The view override is a patched copy of Filament's table view. If you upgrade Filament and something breaks, please open an issue.
Testing
License
MIT. See LICENSE.md.
All versions of filament-header-filters with dependencies
filament/filament Version ^4.0 || ^5.0
spatie/laravel-package-tools Version ^1.15