ptplugins/filament-auto-filters
Filament Auto Filters automatically generates table filters for Filament resources, reducing boilerplate and keeping admin panels consistent. Configure filters with minimal setup and give users faster, more intuitive ways to narrow down records.
Architecture fit. Version 1.4.1 is an additive enhancement to the existing distinctOptionsUsing hook, which is the package's supported extension point for generating distinct-value option lists (typically for filter/select controls). It does not alter the service provider, config surface, or query layer. The change lets the callback return either a flat list (legacy) or an associative value => label map, which is the idiomatic Laravel pattern for decoupling stored values from display labels. This fits cleanly into existing Laravel conventions (callbacks returning arrays, config-driven thresholds) and requires no new dependencies.
Integration feasibility. High. The feature is opt-in: teams returning a flat list see identical behavior (natural sort, value-as-label). Adoption is a single callback change, not a structural refactor. The most valuable capability is server-side label formatting (e.g., currency amounts, enum humanization) without duplicating mapping logic in Blade/Livewire/Inertia components.
Technical risk. Low overall, with a few contained edge cases:
0, "0"). 0 is a legitimate option value (e.g., "zero amount") and dropping it would be a subtle data bug.distinct_max_options still applies; it is unclear whether the threshold counts before or after blank removal and whether it is evaluated on the map or the underlying distinct set.Key questions.
0/"0" preserved?distinct_max_options evaluated pre- or post-blank-filtering, and does ordering affect truncation?Stack fit. Compatible with standard Laravel/PHP stacks and front-end layers that consume plain arrays (Blade, Livewire, Inertia, API resources). Because the package returns data rather than rendering UI, it remains front-end agnostic.
Migration path. No migration, schema change, or config change required. Existing flat-list implementations continue unchanged. Teams can adopt the map form incrementally, one filter at a time, by modifying only the distinctOptionsUsing callback for that field.
Compatibility. Backward compatible by construction (explicitly documented that flat lists retain prior behavior). The compatibility surface to validate is client-side: any component or test asserting an array shape must be updated to tolerate an object when the map form is used. Recommend auditing consumers of distinctOptionsUsing output before rollout, and confirming the package version constraint in composer.json is widened only after that audit.
Sequencing.
Maintenance. Negligible ongoing cost — the change is additive and the callback contract is stable. The durable maintenance item is documentation: teams need a clear internal note on when to return a list versus a map, and on the blank-handling and ordering guarantees.
Support. Expect a modest support tail from two sources: (a) confusion when a filter suddenly renders as an object-shaped payload, and (b) label formatting questions (escaping, translation, number/currency formatting). Pre-empting both with a short internal guide should keep this near zero.
Scaling. The callback executes in the option-generation path, so cost scales with distinct cardinality, not row count — acceptable. The real scaling risk is indirect: if labels require lookups (e.g., joining a lookup table), a naive implementation can introduce N+1 queries at render time. Mitigate by resolving labels from a preloaded map or cache. The distinct_max_options threshold remains the primary guardrail against unbounded option payloads and should be tuned per field rather than left at a global default.
Failure modes.
0/"0" values silently dropped as "blank" (low likelihood, high severity — silent data loss in filters).Ramp-up. Low. A developer familiar with Laravel callbacks can adopt this in under an hour. The learning curve is almost entirely about the two output contracts and their serialization differences, not about the package itself. Net assessment: worth adopting for filters where display labels differ from stored values; low risk, small effort, and a genuine reduction in duplicated presentation logic.
How can I help you explore Laravel packages today?