Language Switch by Eii Tech Solutions
CommunityAdd a top-bar language switcher dropdown to your Filament panel. Supports configurable locales with native names, optional SVG flags, LTR/RTL directions, and persists the selected language via session and cookie. Fully customizable with publishable config, views, and flag assets.
Author:
Eii Tech Solutions
Package health
Automated checks of this plugin's Composer package
17 checks
- Skipped: GitHub Actions pinned to SHA
- Skipped: GitLab CI includes pinned to SHA
-
Failed:
Recent release is immutable
—
The tag
v1.0.3was pushed without a release. Only releases can be made immutable, so the tag can still be moved. View details on Plumb - Passed: Release tags have not been moved — No version tag has been seen moving.
- Passed: Open security advisories
- Passed: Dependabot PR responsiveness — No open Dependabot PRs.
- Skipped: Renovate MR responsiveness
- Passed: Dependabot or Renovate configured
- Passed: Dependency update cooldown configured
- Passed: Provides a security policy
- Passed: Abandoned or archived — No consulted source marks the package abandoned (packagist, github).
- Passed: Commit and release recency — Active: last commit 2 days ago; last release 2 days ago.
-
Passed:
composer.lock not committed by library
—
composer.lockis absent from the released dist archive. - Passed: Dist archive is lean
-
Passed:
Current Laravel version supported
— Package dependencies resolve together with current Laravel
13.0. -
Passed:
Current PHP version supported
— Constraint
^8.3supports current PHP8.6. - Skipped: Current Symfony version supported
filament/
namespace. Review the source and install at your own risk. Found
malware or an unresolved security issue the author won't
address?
Report it
.
Documentation
- Features
- Requirements
- Installation
- Filament Panel Registration
- Configuration
- Customize Switcher Position (Render Hook)
- Starter Flags (Built-in + Your Own)
- Publish and Customize View
- How It Works
- Security
- License

A lightweight Filament v5 plugin that adds a topbar language switcher to your panel.
It persists the selected locale in session + cookie, applies it on each panel request, and supports LTR / RTL language directions.
#Features
- Topbar dropdown switcher for supported locales
- Works with Filament Panels (v5)
- Locale persistence using session and cookie
- Configurable default/fallback locales
- Configurable locale metadata (
name,native,dir,country,flag) - Optional custom SVG folder via
flags_path - Built-in starter SVG flags with fallback resolution
- RTL-ready via locale direction config
- Publishable config, views, and starter flags
#Requirements
- PHP 8.3+
- Laravel 13+
- Filament 5+
#Installation
composer require eii/filament-language-switch
Laravel package discovery registers the service provider automatically.
#Filament Panel Registration
Register the plugin on each panel where you want the switcher to appear.
Important: register the plugin after panel middleware configuration.
use Eii\FilamentLanguageSwitch\LanguageSwitchPlugin;
use Filament\Panel;
public function panel(Panel $panel): Panel
{
return $panel
// ...
->middleware([
// your middleware...
])
->plugin(LanguageSwitchPlugin::make());
}
#Configuration
Publish config:
php artisan vendor:publish --tag=filament-language-switch-config
Then edit config/localization.php:
return [
'default' => env('APP_LOCALE', 'en'),
'fallback' => env('APP_FALLBACK_LOCALE', 'en'),
// Toggle flags on/off (default: false)
'show_flags' => env('LOCALIZATION_SHOW_FLAGS', false),
// Optional path to your own SVG flag files (absolute or relative to base_path)
'flags_path' => env('LOCALIZATION_FLAGS_PATH', null),
'locales' => [
'en' => [
'name' => 'English',
'native' => 'English',
'dir' => 'ltr',
'country' => 'US', // Optional: country name or code (e.g. 'US' or 'United States')
'flag' => null, // Optional: inline SVG string or filename in flags_path (e.g. 'us.svg')
],
'ar' => [
'name' => 'Arabic',
'native' => 'العربية',
'dir' => 'rtl',
'country' => 'SA',
'flag' => null,
],
],
];
#Display Format Rules
- If
show_flagsistrue:<flag> <locale> (<country>)(or<flag> <locale>if country is blank). - If
show_flagsisfalse:<locale> (<country>)(or<locale>if country is blank). - Selected language is highlighted in Filament's primary color with a sleek circular dot indicator instead of a plain checkmark.
- The developer can choose to provide a country code (e.g.
US), a full country name (e.g.United States), or leave it blank. - The flag can be an inline
<svg>...</svg>string, or a filename inside theflags_pathdirectory (e.g.'us.svg'). - Resolution order:
locales.*.flag(inline SVG or filename) →flags_path/{country|locale}.svg→ built-in package flag views.
If only one locale is configured, the dropdown is hidden automatically.
#Customize Switcher Position (Render Hook)
Default hook: PanelsRenderHook::GLOBAL_SEARCH_AFTER
You can move it:
use Filament\View\PanelsRenderHook;
->plugin(
LanguageSwitchPlugin::make()
->renderHook(PanelsRenderHook::TOPBAR_END)
)
#Starter Flags (Built-in + Your Own)
The package includes a small starter set under the internal filament-language-switch::flags.* views.
To use your own full set, place SVG files in any folder (for example resources/flags/filament-language-switch) and set:
LOCALIZATION_FLAGS_PATH=resources/flags/filament-language-switch
Or set directly in config (absolute or relative to base_path()):
'flags_path' => 'resources/flags/filament-language-switch',
You can also publish the starter SVG files:
php artisan vendor:publish --tag=filament-language-switch-flags
#Publish and Customize View
php artisan vendor:publish --tag=filament-language-switch-views
Published path:
resources/views/vendor/filament-language-switch/locale-switcher.blade.php
#How It Works
- The switcher calls
GET /locale/{locale} - Locale is validated against
localization.locales - Locale is stored in session and cookie
- Middleware resolves locale in this order:
- Session
- Cookie
localization.default
app()->setLocale(...)and Carbon locale are applied per request
#Security
Please review SECURITY.md for vulnerability reporting.
#License
This package is open-sourced software licensed under the MIT License.
Developed and maintained by Amit Haldar
From Eii Tech Solutions
If you find this package useful, consider giving it a ⭐ on GitHub!
The author
Eii Tech Solutions is a software development company based in Tokyo, Japan. We build practical Laravel and Filament packages, developer tools, and reusable solutions focused on simplicity, reliability, and security. Our packages are developed and maintained by Amit Haldar, with a focus on making everyday development easier for the Laravel and Filament community.
From the same author
Arqon Forms
Arqon Forms is a lightweight, dynamic form builder for Laravel and Filament 5. Create, preview, publish, and manage forms directly from your Filament panel, with flexible fields, real-time validation, spam protection, and submission management.
Author:
Eii Tech Solutions
Arqon SEO
A flexible SEO metadata manager for Laravel and Filament, featuring automatic model discovery, static route management, Open Graph tags, and centralized SEO settings.
Author:
Eii Tech Solutions
Lucide Icons
A lightweight Filament plugin that integrates Lucide icons with configurable global stroke width.
Author:
Eii Tech Solutions
Editable Text Column
An enhanced Filament TextColumn that lets users edit table values directly through a modal, supporting plain text input, selectable options, and badge display with BackedEnum support.
Author:
Eii Tech Solutions
Featured Plugins
A selection of plugins curated by the Filament team
Noir Theme
A theme that gives panels a focused, refined look with near-black surfaces, crisp actions, and restrained color.
Filament
Compact Theme
A theme that makes data-heavy panels easier to scan by fitting more useful information on each screen.
Filament
Advanced Tables (formerly Filter Sets)
Supercharge your tables with powerful features like user-customizable views, quick filters, multi-column sorting, advanced table searching, convenient view management, and more. Compatible with Resource Panel Tables, Relation Managers, Table Widgets, and Table Builder!
Kenneth Sese