tomatophp/filament-language-switcher
A configurable language switcher for Filament panels that lets users change the app locale from the topbar or user menu. Supports custom language lists, flags, RTL layouts, and simple Laravel localization integration.
app.locale fallback. That is roughly a week of undifferentiated work plus ongoing edge-case maintenance. Scope it as an enabler for any multi-locale admin experience and spend product effort on work only your team can differentiate.model / model_id query parameters. Pre-v5 behavior instantiated any class named in the request and allowed one user to change another user’s language. Any pre-v5 deployment should be logged as a security finding with an owner and a remediation date.^5.0 constraint, not a floating range. The important change in this package is a security change; a routine composer update should not decide when you cross that line.4.x branch; they do not confirm the v5 security fix was backported. Until that is confirmed in writing, “we’ll just stay on 4.x” is not an acceptable answer for a user-facing admin surface.app.locale fallback, and a fix for rendering when the current locale is not configured. That reads as active hardening, not abandonment — but budget for the possibility of forking.Adopt when:
app.locale for users who never chose.model / model_id are ignored, unconfigured locales are rejected, and a victim user’s language cannot be changed by another user.Look elsewhere or build alongside when:
Accept-Language negotiation, or content translation. This package switches a stored user preference; it is not a localization platform.4.x. Treat every pre-v5 deployment as an open security finding, not a default.users.language assumption, or your user model lives on a non-standard table. That is the most likely reason you will need to read the source or override; confirm it in a test immediately after install.For executives — the one-paragraph version. This is a small, MIT-licensed Filament plugin that adds a per-user language switcher to the admin panel. The v5 release closes a real security gap: previously, a crafted request could change another user’s language or instantiate an arbitrary class; now the route only updates the signed-in user, rejects guests, rejects unconfigured locales, and ignores user-supplied model parameters. The cost is low and the scope is bounded, but it is coupled to the Filament 5 / Livewire 4 / Laravel 12 upgrade. Recommendation: adopt ^5.0 as a rider on that upgrade, pin the major explicitly, and resolve in writing whether the v4 branch received the security backport before any pre-v5 deployment remains in production.
For engineering — the operating summary. Register the plugin per panel, keep the locale allowlist in config/filament-language-switcher.php, and treat config labels as user-facing copy. Publish and read the migration before the install command runs in a pipeline; in v5 it runs migrations in-process, which is convenient locally but should be an observable deploy step in CI. Add middleware after auth to apply user->language with an allowlist guard and fall back to app.locale; do not backfill nulls unless you want to freeze today’s default. Mirror the four security cases in tests, plus UI cases for missing current locale, show_flags on/off, untranslated locale names, and null user locale. Under Octane or long-lived workers, set and reset locale at request/job boundaries. Keep the integration thin so forking remains cheap.
Decision ask. Approve adoption of tomatophp/filament-language-switcher:^5.0 after the Filament 5 upgrade lands, assign an owner to confirm the 4.x backport status in writing, and budget a small contingency for taking ownership of a 37-star, single-maintainer package. Do not frame this as a localization platform; frame it as a safe, cheap topbar preference backed by one column and one config file.
How can I help you explore Laravel packages today?