Weave 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 Language Switcher Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy — buy, and treat it as infrastructure, not a feature. A language switcher is a bounded surface: configurable topbar dropdown, translated locale names, optional flags, per-user persistence, and 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.
  • Security posture — v5 is a risk-closure decision, not a feature decision. v5.0.0 restricts the switch route to the signed-in user’s language, returns 403 to guests, rejects unconfigured locales, and ignores 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.
  • Version pinning as a product guardrail. Adopt with an explicit ^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.
  • Roadmap coupling — sequence it as a rider, not a standalone initiative. v5 hard-requires Filament v5, Livewire 4, Laravel 12/13, and PHP 8.2+. Adopting v5 means the Filament 5 migration is already funded or is being forced by this choice. If the team is intentionally staying on Filament v4 for a quarter or more, this package no longer tracks that path by default.
  • Open risk to resolve before sign-off. Release notes say the Filament v4 code is preserved on the 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.
  • Adoption signal, read honestly. 37 stars, zero dependents, MIT, effectively single-maintainer — thin external validation. The counterweight is real: v5 ships a new test suite with coverage, screenshots, an install command that runs migrations in-process, an 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.
  • Use cases this unblocks: multi-language internal admin tooling; per-user (explicitly not per-tenant) locale preference; localization QA where a reviewer flips languages on their own account; support and demo scenarios where a non-technical operator can switch languages safely; customer-facing panels only by deliberate decision, because that turns an internal preference into a customer-visible toggle.

When to Consider This Package

Adopt when:

  • Your admin surface is Filament and you already run — or are funded to move to — Filament v5 / Livewire 4 / Laravel 12+ on PHP 8.2+.
  • Locale is a per-user preference. v5’s security model enforces exactly that, so the fix aligns with intended design rather than fighting it.
  • You need a switcher in days, not a localization subsystem in weeks.
  • You want the locale list in config with translated display names, optional flags, and a safe fallback to app.locale for users who never chose.
  • You can keep the integration thin: one topbar dropdown, one user column, one config file, and a small middleware to apply the stored locale per request.
  • You are willing to own the four security assertions in CI: guests get 403, 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:

  • You need tenant-level locale, session locale, geo/Accept-Language negotiation, or content translation. This package switches a stored user preference; it is not a localization platform.
  • You are staying on Filament v4 and cannot get written confirmation that the v5 security fix was backported to 4.x. Treat every pre-v5 deployment as an open security finding, not a default.
  • You need a large, well-supported dependency with broad community validation. This is a small, single-maintainer package; keep it forkable and avoid building tenant/session negotiation on top of it.
  • Your locale column is not the 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.
  • You need the switcher on a customer-facing panel without a deliberate product decision. Adding the plugin per panel is easy; turning a per-user preference into a customer-visible toggle should be intentional.

How to Pitch It (Stakeholders)

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.

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.
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource