New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

madbox-99/laravel-locale-switcher

Simple locale switcher for Laravel applications using cookies.
1,561
Install
composer require madbox-99/laravel-locale-switcher
Latest Version:v1.1.1
PHP:^8.2
Laravel:11 · 12 · 13
License:MIT
Last Updated:Jul 17, 2026
Links: GitHub  ·  Packagist
Maintainer: MadBox-99

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...

648,266,899 9,701
laravel/framework

The Laravel Framework.

604,216,237 34,982
laravel/tinker

Powerful REPL for the Laravel framework.

512,508,631 7,443
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

429,221,767 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

403,217,078 4,664

Version History

Version Released PHP Laravel License
v1.1.1 ^8.2 ^11.0|^12.0|^13.0 MIT
v1.1.0 ^8.2 ^11.0|^12.0|^13.0 MIT
v1.0.0 ^8.2 ^11.0|^12.0|^13.0 MIT