Download the PHP package amrikasir/lang-selector without Composer
On this page you can find all versions of the php package amrikasir/lang-selector. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download amrikasir/lang-selector
More information about amrikasir/lang-selector
Files in amrikasir/lang-selector
Package lang-selector
Short Description Livewire-based language selector for Laravel 11
License MIT
Informations about the package lang-selector
Laravel Lang Selector
A simple, elegant, and reusable Livewire 3/4 language switcher for Laravel 11.
This package provides a ready-to-use dropdown component to switch application locales dynamically β complete with middleware, configuration, and publishable views.
β¨ Features
- β‘ Supports Livewire 3 and 4
- π Easy multi-language switching (session-based)
- βοΈ Configurable via
config/lang-selector.php - π¨ Publishable views for full customization
- π§© Simple integration with your existing layout
π¦ Installation
Require the package via Composer:
βοΈ Publish Config & Views
You can publish the default configuration and views to customize them:
This will create:
π§© Usage
- Register Middleware
In app/Http/Kernel.php, add the middleware to your web group:
- Add Component to Blade
Just drop the component anywhere in your layout:
Thatβs it! π
The dropdown will automatically display all available locales from your config.
βοΈ Configuration
config/lang-selector.php
π§ How It Works
- The
LocaleMiddlewaresetsApp::setLocale()based on the session. - The
LanguageSelectorLivewire component updates session locale dynamically. - The selected locale persists until changed again.
π§° Example Styling
You can freely modify the published views at:
Example minimal Tailwind version:
π§Ύ License
This package is open-sourced software licensed under the MIT license.
All versions of lang-selector with dependencies
illuminate/support Version >=11.0
livewire/livewire Version ^3.0 || ^4.0
vemcogroup/laravel-translation Version ^3.0