niels-numbers/laravel-localizer

Detects the user’s preferred language and redirects to the matching localized URL.

Maintainers

Package info

github.com/niels-numbers/laravel-localizer

pkg:composer/niels-numbers/laravel-localizer

Statistics

Installs: 265

Dependents: 0

Suggesters: 0

Stars: 9

Open Issues: 5

v1.2.1 2026-05-07 22:12 UTC

This package is auto-updated.

Last update: 2026-05-07 22:15:04 UTC


README

Tests PHP Laravel License

Successor to mcamara/laravel-localization. Static routes, route:cache ready.

Locale-aware routing for Laravel: auto-detect, auto-redirect, and resolve route() per language.

Documentation: localizer.adam-nielsen.de

Example

Route::localize(function () {
    Route::get('/about', AboutController::class)->name('about');
});

Produces:

  • /about for the default locale (e.g. English), prefix hidden
  • /de/about, /fr/about, ... for every other configured locale

In your application code, keep using route('about'); the package picks the right variant based on the current locale.

Install

composer require niels-numbers/laravel-localizer

Setup guide · Migrating from mcamara/laravel-localization?

License & credits

MIT licensed. Created by Adam Nielsen, building on prior work by @mcamara (original laravel-localization), @codezero-be (deprecated laravel-localized-routes, whose static-route ideas inspired this rewrite) and @jordyvanderhaegen (current maintainer of the original, whose issue #921 motivated this package).