chaim-chv/filament-enum-plural-label
A small Filament plugin that adds plural labels to PHP enums, so enum-backed options read naturally across forms, tables, and filters. Define singular and plural labels once and let Filament display the right form wherever your enum is used.
What changed. v2.0.0 is a compatibility release, not a feature release. It targets Filament v5, raises the PHP floor to 8.2, declares illuminate/contracts (^11.28|^12.0|^13.0) explicitly for the Htmlable type, and — most importantly from a governance standpoint — adds the package's first automated test suite (19 tests / 34 assertions) and a GitHub Actions CI matrix across PHP 8.2/8.3/8.4.
Architecture fit. The package occupies a small, well-bounded slot: it converts enum-backed values (string-backed, int-backed, and unit enums) into display output that is string, int, Htmlable, or null, and integrates with Filament resources. That is a narrow surface with few architectural dependencies — it does not own persistence, routing, auth, or queue behaviour. The explicit illuminate/contracts declaration is a genuine improvement: previously the Htmlable type was implicitly satisfied by the framework, and an undeclared transitive dependency is exactly the kind of thing that breaks silently on a Laravel major. This is a maturity signal, not just a version bump.
Integration feasibility. High, with one caveat. The constraint set (PHP 8.2+, Laravel 11.28+/12/13, Filament 5+) mirrors Filament 5's own upstream requirements, so the package is tracking the framework rather than inventing its own envelope — low risk of divergence. The caveat is Laravel ^13.0: no Laravel 13 exists in the wild yet, so that constraint is aspirational. Accepting it in require is forward-friendly but means the CI matrix cannot actually validate it. We would be running on Laravel 11.28/12 only, and should treat 13 as untested until upstream ships.
Technical risk.
composer update on any lagging panel. The package correctly points users at v1.x, which converts a hard break into a branch-pinning exercise — acceptable, provided v1.x is actually maintained (see below).Htmlable, null, and one Filament resource integration — is a reasonable smoke net, but the phrase "Filament resource integration" in the singular suggests the highest-risk area (real panel rendering, Livewire lifecycle, table/column rendering) is the thinnest. There is no evidence of static analysis (PHPStan/Psalm), a code-style gate, coverage reporting, or a security policy.Htmlable implies raw HTML. Any path that returns Htmlable bypasses Blade escaping. Whether the package sanitizes or delegates entirely to the caller is the single most important thing to verify before we rely on it for user-influenced data.null returns fail silently. A null display result is a blank cell in a Filament table — no exception, no log. Low blast radius but poor observability.Key questions for the maintainer.
v1.x in maintenance — bug fixes only, or security fixes only — and for how long? What is the published EOL date?Htmlable output sanitized by the package, or is escaping entirely the caller's responsibility? Please document whichever it is.^13.0 in illuminate/contracts declared pre-emptively, or has it been tested against a 13.x-dev branch?Stack fit. Clean, provided we are already on PHP 8.2+ and Laravel 11.28+. This is a presentation-layer dependency only — it has no migration, no config publish requirement mentioned, and no runtime service that needs supervising. It belongs in require (not require-dev) for any panel that uses it, and is safe to isolate to the panel-facing application layer rather than shared domain packages.
Compatibility matrix.
| Package version | PHP | Laravel | Filament | Status for us |
|---|---|---|---|---|
| v2.0.0 | 8.2 – 8.4 (CI) | 11.28, 12 (13 declared, untested) | v5+ | Target state |
| v1.x | 8.1+ | per v1 docs | v3 / v4 | Fallback / bridge |
Migration path. The upgrade is monotonic and cannot be done in one step — the package bump is the last action, not the first:
v1.x; the package is not the constraint here.v1.x, so any breakage is unambiguously Filament's and not the package's.v2.0.0. At this point the diff should be near-zero and any failure is clearly attributable.Sequencing and scope. Treat this as a ride-along on the Filament 5 upgrade, not a standalone project. If the Filament 5 migration is already funded, adding this is a few hours. If it is not, this package is not a reason to start one — pin v1.x, add a ticket to the Filament 5 epic, and move on.
Guardrails.
"vendor/package": "2.0.0") rather than floating ^2.0, at least for the first cycle; a 2.0.x patch on a package with 19 tests should be reviewed, not auto-adopted.conflict or documented constraint so a partial upgrade (Filament 5 with package v1.x, or vice versa) fails loudly at install time rather than at render time.Maintenance. Low steady-state cost, but the dependency maintenance is the real load: this package's release cadence is dictated by Filament's major cadence, and Filament has shipped v3 → v4 → v5 in short order. Expect a v3.0.0 within roughly the same interval Filament takes to ship v6, and expect it to be another breaking drop of the previous Filament major. Budget for a recurring, small, forced-upgrade task, not a one-off.
Support. No vendor; support is the maintainer's issue tracker plus our own reading of a small codebase. Before adoption, ask for the maintenance/EOL statement for v1.x — if v1.x goes dark the moment v2 ships, any panel we cannot move to Filament 5 becomes a blocked upgrade with no upstream fix path. That is the single largest support risk and it is a policy question, not a code question.
Scaling. Effectively irrelevant at our scale. This is per-request formatting logic with no I/O, no caching layer, no state. The only scaling-adjacent concern is rendering large tables: if the package performs enum reflection per cell, it is worth a glance at a 500-row table, but the return types suggest simple resolution and the risk is negligible. No horizontal-scaling implications.
Failure modes.
null return renders nothing with no warning. Symptom is a UI gap reported by a user, not an alert. Mitigation: assert non-null on a sample of enum-backed columns during the upgrade, and check for empty columns in the smoke test.Htmlable path is fed user-controlled content and is not sanitized, this becomes an XSS vector and a security incident rather than a bug. This is the failure mode that justifies the review question above; do not adopt for untrusted input until it is answered.Htmlable. Mitigation: only move to Laravel 13 after this package (or a successor release) has CI coverage for it.Ramp-up. Minimal for engineers — the API is a handful of enum-to-display conversions over a standard Filament idiom, and anyone who has written a Filament column will be productive in well under an hour. The genuine ramp-up cost sits with platform work: getting the estate onto PHP 8.2+ and Filament 5. Assign the upgrade to whoever owns the Filament 5 migration, not to a feature team, and document the v1.x-vs-v2.0.0 pinning rule in the repo README so the next engineer does not discover the break via a failed composer update.
How can I help you explore Laravel packages today?