Skip to content

Laravel LocalizerLocalized URLs for Laravel

Detect a visitor's language, redirect to the matching locale, and let `route('about')` always pick the right URL - fully `route:cache` compatible.

30-second example

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

Produces:

  • /about - default locale (e.g. English), prefix hidden
  • /de/about - German
  • /fr/about - French (and so on for every configured locale)

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

Successor to mcamara/laravel-localization

This package is the official successor to mcamara/laravel-localization, rebuilt on static routes so that php artisan route:cache works out of the box and translated routes resolve through Laravel's own URL generator - no URI parsing required.

Migrating from the original? See the step-by-step migration guide.

Released under the MIT License.