Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Filament Header Filters Laravel Package

leek/filament-header-filters

Add inline filters to Filament table column headers. Attach any BaseFilter (selects, date pickers, min/max ranges, custom schemas) as a richer alternative to individual searchable fields. Works with Filament v4/v5, PHP 8.2+.

View on GitHub
Deep Wiki
Context7
v2.0.8

Header filters stay applied after the table is rebuilt

Header-filter registration was gated by a once-per-request boolean flag, and the filters were pushed onto the table imperatively. When a consumer calls resetTable() — e.g. a page that re-renders the table after an external page filter or action changes — bootedInteractsWithTable() rebuilds the table from scratch and drops those pushed filters. The flag stayed true, so they never re-registered.

The result was a confusing bug: a header filter showed as selected but stopped actually filtering the table.

Fix

Registration is now tracked per Table instance via a WeakMap in HeaderFilterRegistry, rather than a component-level boolean. A rebuilt table is a new instance, so registration runs again and the filters are re-applied — while staying idempotent within a single render.

If you added a resetTable() workaround in your own page to force re-registration, you can drop it after upgrading.

v2.0.7

Multi-select header filters now render cleanly in narrow columns

Previously, selecting 2+ options in a multi-select header filter stacked a full-width badge per selection, wrapping each long label character-by-character and blowing up the row height.

The filter now collapses to a single line:

  • the column widens to fit (min-width: 16rem) when a multi-select carries a selection,
  • the first selection is shown ellipsised so it stays readable,
  • the remaining selections are summarized as a +N overflow count.

CSS-only — no API or behavior changes. Pull options still toggle individual selections from the dropdown.

v2.0.6

What's changed

  • Guard the column-search visibility check so hasHeaderFilters() is only called when the method or macro is actually registered, preventing errors on tables that don't use header filters (thanks @luca-alsina, #3).

Verification

  • php -d memory_limit=1G vendor/bin/pest
  • vendor/bin/pint --test
v2.0.4

What's changed

  • Register header filters after the Filament table is initialized, including custom HasTable pages where Livewire trait boot order differs.
  • Normalize seeded single-select header filter state so stale array values from previous multi-select usage do not render as blank selected values.

Verification

  • php -d memory_limit=1G vendor/bin/pest
  • vendor/bin/pint
v2.0.3
  • Refines header filter sizing so controls fill the header cell while retaining practical minimum widths.\n- Adds sizing support for multi-field date range header filters.\n- Removes the overflow override on Filament table scroll containers to avoid horizontal scroll position jumps when opening dropdowns.
v2.0.2

Fixed

  • Let the Filament wrapper stack inside header filters fill available width instead of shrink-wrapping with max-content.
  • Keeps the compact select trigger and dropdown panel minimum widths from v2.0.1.
v2.0.1

Fixed

  • Set the closed select trigger minimum width to 4rem.
  • Set the dropdown panel minimum width to 12rem while keeping the viewport cap.
v2.0.0

Changed

  • Header filter CSS is now imported by the consuming app panel theme.
  • The documented import path is now vendor/leek/filament-header-filters/resources/css/filament-header-filters.css.
  • Removed the generated resources/dist stylesheet and package-local Vite build files.

Upgrade

Add the package stylesheet to your Filament panel theme after the Filament theme import, then rebuild your app assets with npm run build.

v1.0.2

Changed

  • Let header filter cells size from table content instead of forcing a fixed cell width.
  • Shrink-wrap Filament select wrappers while keeping a 12rem minimum for select controls.
  • Set header select dropdown panels to content width with a 4rem minimum and viewport cap.
v1.0.1

Vite-built CSS sources (package.json, vite.config.js, resources/css, resources/js), refreshed dist CSS, art update, .gitignore for /.claude, minor pint cleanup of the trait. No API changes.

v1.0.0

First stable release.

Features

  • ->headerFilter(BaseFilter $filter) on any table column. Accepts SelectFilter, Filter, and any BaseFilter subclass.
  • Shared state with panel filters (tableFilters). Indicators, reset, and session persistence work.
  • Always live — applies immediately regardless of deferFilters().
  • Auto-hidden field labels — column header serves as the label.
  • Hidden columns' filters are skipped from the query.

Requirements

  • PHP 8.2+
  • Filament v4.x or v5.x

Install

composer require leek/filament-header-filters

Add the HasHeaderFilters trait to any Livewire component using InteractsWithTable:

use Leek\FilamentHeaderFilters\Concerns\HasHeaderFilters;

class ListOrders extends ListRecords
{
    use HasHeaderFilters;
}

See README for dropdown, min/max, and date range examples.

Free port of filamentphp/filament#19432.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
directorytree/privacy-filter-classifier
directorytree/privacy-filter
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata
splash/openapi
splash/scopes
splash/toolkit
testo/output-teamcity
testo/bridge-symfony
spatie/flare-daemon-runtime