craft-forge/filament-language-switcher
resources/lang/) to function optimally. Misalignment here could lead to silent failures.locale.changed events, enabling downstream systems (e.g., API clients, frontend JS) to react to language changes. Critical for multi-channel apps (admin + frontend).craft-forge namespace), but works with any Filament-based app. Translation file structure must match Filament’s expectations (e.g., filament/locales/{locale}.json).laravel-flag-icons). If this package is deprecated or removed, the UI could break.resources/lang/ or a custom location?app()->locale)?app()->locale or show an error?en-US, en-GB)? The package supports this but may require manual locale mapping.| Component | Supported Versions | Notes |
|---|---|---|
| Laravel | 9.x–11.x | PHP 8.1+ required |
| Filament | 3.x–5.x | Plugin system must be enabled |
| PHP | 8.1–8.3 | No breaking changes in target range |
| Translation Files | Filament JSON format | Custom formats need manual config |
filament/filament:^5.0).composer require craft-forge/filament-language-switcher
AdminPanelProvider (or other panel providers):
->plugins([
FilamentLanguageSwitcherPlugin::make()
->locales(['en', 'fr', 'es']) // Optional: override auto-detection
->cookieName('locale') // Optional: customize cookie
])
locale.changed events fire correctly (e.g., log or broadcast changes).spatie/laravel-translatable) should not conflict if they respect Laravel’s app()->locale.SetLocale), ensure it doesn’t override the switcher’s session cookie.locale.changed event to frontend via Laravel Echo or a custom API endpoint.laravel-flag-icons for updates/removals.->locales()) may need updates if translation files change.storage/logs/laravel.log for missing locale files.locale.changed listeners are registered.config/app.php as a safety net.| Scenario | Impact | Mitigation |
|---|---|---|
| Missing translation files | Broken UI or default locale | Manual locale config + alerts |
| Session driver misconfiguration | Locale not persisting | Test with file session driver |
| Filament version mismatch | Plugin crashes | Pin Filament version in composer.json |
locale.changed event not firing |
Frontend out of sync | Add logging/debugging |
| Flag icons missing | UI regression | Fallback to text labels |
locale.changed events.panel() and revert to manual locale handling (e.g., middleware).How can I help you explore Laravel packages today?