madbox-99/laravel-locale-switcher
Laravel Locale Switcher
A lightweight Laravel package for switching locales in applications using cookies or URL prefixes.
Features
- Switch locales from routes or middleware
- Support cookie-based locale persistence
- Support URL-prefix-based locale handling
- Blade components for locale dropdowns and hreflang tags
- Easy integration with Laravel applications
Installation
Install via Composer:
composer require madbox-99/laravel-locale-switcher
Publish the package configuration if needed:
php artisan vendor:publish --provider="MadBox\\LocaleSwitcher\\LocaleSwitcherServiceProvider"
Usage
The package provides helpers and middleware to set the current locale, switch between languages, and expose locale-aware routes and views.
Testing
Run the test suite with:
./vendor/bin/pest
Related Packages
doctrine/dbal
Powerful PHP database abstraction layer (DBAL) with many features for database s...
637,827,751
9,703
laravel/serializable-closure
Laravel Serializable Closure provides an easy and secure way to serialize closur...
413,412,504
609
nunomaduro/collision
Cli error handling for console/command-line PHP applications.
391,429,217
4,660