PHPackages                             skyraptor/laravel-localized-routes - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. skyraptor/laravel-localized-routes

ActiveLibrary[Localization &amp; i18n](/categories/localization)

skyraptor/laravel-localized-routes
==================================

A convenient way to set up, manage and use localized routes in a Laravel app.

2.7.2(3y ago)0640MITPHPPHP ^7.1|^8.0

Since Apr 3Pushed 3y agoCompare

[ Source](https://github.com/bumbummen99/laravel-localized-routes)[ Packagist](https://packagist.org/packages/skyraptor/laravel-localized-routes)[ Fund](https://paypal.me/ivanvermeyen)[ Fund](https://ko-fi.com/ivanvermeyen)[ RSS](/packages/skyraptor-laravel-localized-routes/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (1)Dependencies (6)Versions (26)Used By (0)

Laravel Localized Routes
========================

[](#laravel-localized-routes)

IMPORTANT: March 2022
---------------------

[](#important-march-2022)

[![Support Ukraine](https://raw.githubusercontent.com/hampusborgos/country-flags/main/png100px/ua.png)](https://github.com/hampusborgos/country-flags/blob/main/png100px/ua.png)

It's horrible to see what is happening now in Ukraine, as Russian army is [bombarding houses, hospitals and kindergartens](https://twitter.com/DavidCornDC/status/1501620037785997316).

Please [check out supportukrainenow.org](https://supportukrainenow.org/) for the ways how you can help people there. Spread the word.

And if you are from Russia and you are against this war, please express your protest in some way. I know you can get punished for this, but you are one of the hopes of those innocent people.

---

[![GitHub release](https://camo.githubusercontent.com/9dd6df1fc6a08aef79219fcb271e89d910980384ee15811d6a3b2db319d91194/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f636f64657a65726f2d62652f6c61726176656c2d6c6f63616c697a65642d726f757465732e7376673f7374796c653d666c61742d737175617265)](https://github.com/codezero-be/laravel-localized-routes/releases)[![Laravel](https://camo.githubusercontent.com/426e3ebd5ac1fa9a75ce1e449dfc4c58a75bcc9dcb2fe17b299eff3e83efa76f/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c61726176656c2d392d7265643f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c266c6f676f436f6c6f723d7768697465)](https://laravel.com)[![License](https://camo.githubusercontent.com/778bc9e8967779dc29ef2cf1bb138c4bc5a92766cb1a29823465e97411de7f52/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f636f64657a65726f2f6c61726176656c2d6c6f63616c697a65642d726f757465732e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/b88cc462d86700197844d3770773fae5f25cb95b4953767e5c9c44a7957f5bec/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f636f64657a65726f2d62652f6c61726176656c2d6c6f63616c697a65642d726f757465732f54657374732f6d61737465723f7374796c653d666c61742d737175617265266c6f676f3d676974687562266c6f676f436f6c6f723d7768697465266c6162656c3d7465737473)](https://github.com/codezero-be/laravel-localized-routes/actions)[![Code Coverage](https://camo.githubusercontent.com/3c247dc5f7d00098e3c3fba9d106fe67a99af8a130b7605c520d6e656df0e724/68747470733a2f2f696d672e736869656c64732e696f2f636f646163792f636f7665726167652f61356462386131333231363634653637393030633936656164633537356563652f6d61737465723f7374796c653d666c61742d737175617265)](https://app.codacy.com/gh/codezero-be/laravel-localized-routes)[![Code Quality](https://camo.githubusercontent.com/1d44ee7abeeded8cae61c86a64972bc3aab4c58bd30e75f43a36b2d17c18e5e4/68747470733a2f2f696d672e736869656c64732e696f2f636f646163792f67726164652f61356462386131333231363634653637393030633936656164633537356563652f6d61737465723f7374796c653d666c61742d737175617265)](https://app.codacy.com/gh/codezero-be/laravel-localized-routes)[![Total Downloads](https://camo.githubusercontent.com/04159bb68cbbf2d39d947f559740806f305e3f27d86b71d48ebbafd66e1df373/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f64657a65726f2f6c61726176656c2d6c6f63616c697a65642d726f757465732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/codezero/laravel-localized-routes)

[![ko-fi](https://camo.githubusercontent.com/1fedf764fa06114b797ee53e7506df10880abed6766f854202d758df1707969d/68747470733a2f2f7777772e6b6f2d66692e636f6d2f696d672f676974687562627574746f6e5f736d2e737667)](https://ko-fi.com/R6R3UQ8V)

#### A convenient way to set up and use localized routes in a Laravel app.

[](#a-convenient-way-to-set-up-and-use-localized-routes-in-a-laravel-app)

🧩 Features
----------

[](#-features)

- [Automatically register](#-register-routes) a route for each locale.
- Use [URL slugs or custom domains](#%EF%B8%8F-supported-locales) (or subdomains).
- Optionally [omit the locale slug from the URL for your main locale](#%EF%B8%8F-omit-slug-for-main-locale).
- Optionally [translate each segment](#-translate-routes) in your URI's.
- [Generate localized route URL's](#-generate-route-urls) using the `route()` helper.
- [Redirect to localized routes](#-redirect-to-routes) using the `redirect()->route()` helper.
- [Generate localized signed route URL's](#-generate-signed-route-urls).
- [Generate localized versions of the current URL](#%EF%B8%8F-generate-localized-versions-of-the-current-url) with our `Route::localizedUrl()` macro.
- [Automatically set the appropriate app locale](#%EF%B8%8F-use-middleware-to-update-app-locale) using the middleware.
- Optionally [detect and set the preferred locale in multiple sources](#%EF%B8%8F-use-localizer-to-detect-and-set-the-locale).
- Use localized route keys with [route model binding](#-route-model-binding).
- Allow routes to be [cached](#-cache-routes).
- Localize [`404` pages](#-localized-404-pages-and-redirecting-to-localized-urls).

✅ Requirements
--------------

[](#-requirements)

- PHP &gt;= 7.1
- Laravel &gt;= 5.6

📦 Install
---------

[](#-install)

```
composer require codezero/laravel-localized-routes
```

> Laravel will automatically register the ServiceProvider.

⚙️ Configure
------------

[](#️-configure)

#### ☑️ Publish Configuration File

[](#️-publish-configuration-file)

```
php artisan vendor:publish --provider="CodeZero\LocalizedRoutes\LocalizedRoutesServiceProvider" --tag="config"
```

You will now find a `localized-routes.php` file in the `config` folder.

#### ☑️ Supported Locales

[](#️-supported-locales)

##### Using Slugs

[](#using-slugs)

Add any locales you wish to support to your published `config/localized-routes.php` file:

```
'supported-locales' => ['en', 'nl', 'fr'],
```

This will automatically prepend a slug to your localized routes. [More on this below](#-register-routes).

##### Using Domains

[](#using-domains)

Alternatively, you can use a different domain or subdomain for each locale by configuring the `supported-locales` like this:

```
'supported-locales' => [
  'en' => 'example.com',
  'nl' => 'nl.example.com',
  'fr' => 'fr.example.com',
],
```

#### ☑️ Omit Slug for Main Locale

[](#️-omit-slug-for-main-locale)

Specify your main locale if you want to omit its slug from the URL:

```
'omit_url_prefix_for_locale' => null
```

Setting this option to `'en'` will result, for example, in URL's like this:

- English: `/some-url` instead of the default `/en/some-url`
- Dutch: `/nl/some-url` as usual
- French: `/fr/some-url` as usual

> This option has no effect if you use domains instead of slugs.

#### ☑️ Use Middleware to Update App Locale

[](#️-use-middleware-to-update-app-locale)

By default, the app locale will always be what you configured in `config/app.php`. To automatically update the app locale when a localized route is accessed, you need to use a middleware.

**⚠️ Important note for Laravel 6+**

To make route model binding work in Laravel 6+ you always also need to add the middleware to the `$middlewarePriority` array in `app/Http/Kernel.php` so it runs before `SubstituteBindings`:

```
protected $middlewarePriority = [
    \Illuminate\Session\Middleware\StartSession::class, //  true
```

> This will not add the middleware to non-localized routes!

**OR, for every route using the `web` middleware group**

You can manually add the middleware to the `$middlewareGroups` array in `app/Http/Kernel.php`:

```
protected $middlewareGroups = [
    'web' => [
        \Illuminate\Session\Middleware\StartSession::class, // name('about')
        ->middleware(\CodeZero\LocalizedRoutes\Middleware\SetLocale::class);

    Route::group([
        'as' => 'admin.',
        'middleware' => [\CodeZero\LocalizedRoutes\Middleware\SetLocale::class],
    ], function () {

        Route::get('admin/reports', ReportsController::class.'@index')
            ->name('reports.index');

    });

});
```

#### ☑️ Use Localizer to Detect and Set the Locale

[](#️-use-localizer-to-detect-and-set-the-locale)

This package can use [codezero/laravel-localizer](https://github.com/codezero-be/laravel-localizer) to automatically detect and set the locale.

With this option disabled, the app locale will only be updated when accessing localized routes.

With this option enabled, the app locale can also be updated when accessing non-localized routes. For non-localized routes it will look for a preferred locale in the session, in a cookie or in the browser. Additionally, it will also store the app locale in the session and in a cookie.

> Enabling this option can be handy if you have, for example, a generic homepage and you want to know the preferred locale.

To enable this option, set it to `true` in the published config file.

```
'use_localizer' => true
```

This option only has effect on routes that use our `SetLocale` middleware.

> You can review [codezero/laravel-localizer](https://github.com/codezero-be/laravel-localizer), publish its config file and tweak it as needed. The only option we will override is `supported-locales`, to match the option in our own config file.

#### ☑️ Set Options for the Current Localized Route Group

[](#️-set-options-for-the-current-localized-route-group)

To set an option for one localized route group only, you can specify it as the second parameter of the localized route macro. This will override the config file settings.

```
Route::localized(function () {

    Route::get('about', AboutController::class.'@index')
        ->name('about');

}, [
    'supported-locales' => ['en', 'nl', 'fr'],
    'omit_url_prefix_for_locale' => null,
    'use_locale_middleware' => false,
]);
```

🚗 Register Routes
-----------------

[](#-register-routes)

Example:

```
// Not localized
Route::get('home', HomeController::class.'@index')
    ->name('home');

// Localized
Route::localized(function () {

    Route::get('about', AboutController::class.'@index')
        ->name('about');

    Route::name('admin.')->group(function () {
        Route::get('admin/reports', ReportsController::class.'@index')
            ->name('reports.index');
    });

});
```

In the above example there are 5 routes being registered. The routes defined in the `Route::localized` closure are automatically registered for each configured locale. This will prepend the locale to the route's URI and name. If you configured custom domains, it will use those instead of the slugs.

URIName/homehome/en/abouten.about/nl/aboutnl.about/en/admin/reportsen.admin.reports.index/nl/admin/reportsnl.admin.reports.indexIf you set `omit_url_prefix_for_locale` to `'en'` in the configuration file, the resulting routes look like this:

URIName/homehome/abouten.about/nl/aboutnl.about/admin/reportsen.admin.reports.index/nl/admin/reportsnl.admin.reports.index**⚠️ Beware that you don't register the same URL twice when omitting the locale.**You can't have a localized `/about` route and also register a non-localized `/about` route in this case. The same idea applies to the `/` (root) route! Also note that the route names still have the locale prefix.

### 🔦 Localized `404` Pages and Redirecting to Localized URL's

[](#-localized-404-pages-and-redirecting-to-localized-urls)

To use these 2 features, you need to register the fallback route **at the end** of your `routes/web.php` file:

```
Route::fallback(\CodeZero\LocalizedRoutes\Controller\FallbackController::class)
    ->middleware(\CodeZero\LocalizedRoutes\Middleware\SetLocale::class);
```

##### 404 - Not Found

[](#404---not-found)

After registering the fallback route the provided controller will look for a 404 error view at `resources/views/errors/404.blade.php`. If this view does not exist, a normal `NotFoundHttpException` will be thrown. You can configure which view to use by changing the `404_view` entry in the config file.

\*\*Some background info...\*\*By default, Laravel's `404` pages don't go trough the middleware and have no `Route::current()` associated with it. Not even when you create your custom `errors.404` view. Therefor, the locale can't be set to match the requested URL automatically via middleware.

To enable localized `404` pages, you need to register a `fallback` route and make sure it has the `SetLocale` middleware. This is basically a catch all route that will trigger for all non existing URL's.

Another thing to keep in mind is that a `fallback` route returns a `200` status by default. So to make it a real `404` you need to return a `404` response yourself.

Fallback routes will not be triggered when:

- your existing routes throw a `404` error (as in `abort(404)`)
- your existing routes throw a `ModelNotFoundException` (like with route model binding)
- your existing routes throw any other exception

Because those routes are in fact registered, the `404` page will have the correct `App::getLocale()` set.

[Here is a good read about fallback routes](https://themsaid.com/laravel-55-better-404-response-20170921).

##### Redirecting to Localized URL's

[](#redirecting-to-localized-urls)

After registering the fallback route, you can update the config option `redirect_to_localized_urls` to `true`. The provided `FallbackController` will then try to redirect routes that have not been registered, to their localized version. If it does not have a localized version, a `404` will be thrown.

> So the home page `/` would be redirected to `/en` if the active locale is `en` and the `/en` route exists. And `/about` would redirect to `/en/about`.

If you configured the app to omit the main locale slug, then the former redirection will obviously not happen, because the unprefixed routes exist. Instead, accessing a prefixed route with the main locale will redirect to an unprefixed URL.

> So if the main locale is `en`, visiting `/en` would redirect to the home page `/` (unless `/` is a registered route). Also `/en/about` would redirect to `/about`.

### 🚕 Generate Route URL's

[](#-generate-route-urls)

You can get the URL of your named routes as usual, using the `route()` helper.

##### 👎 The ugly way...

[](#-the-ugly-way)

Normally you would have to include the locale whenever you want to generate a URL:

```
$url = route(app()->getLocale().'.admin.reports.index');
```

##### 👍 A much nicer way...

[](#-a-much-nicer-way)

Because the former is rather ugly, this package overwrites the `route()` function and the underlying `UrlGenerator` class with an additional, optional `$locale` argument and takes care of the locale prefix for you. If you don't specify a locale, either a normal, non-localized route or a route in the current locale is returned.

```
$url = route('admin.reports.index'); // current locale
$url = route('admin.reports.index', [], true, 'nl'); // dutch URL
```

This is the new route helper signature:

```
route($name, $parameters = [], $absolute = true, $locale = null)
```

A few examples (given the example routes we registered above):

```
app()->setLocale('en');
app()->getLocale(); // 'en'

$url = route('home'); // /home (normal routes have priority)
$url = route('about'); // /en/about (current locale)

// Get specific locales...
// This is most useful if you want to generate a URL to switch language.
$url = route('about', [], true, 'en'); // /en/about
$url = route('about', [], true, 'nl'); // /nl/about

// You could also do this, but it kinda defeats the purpose...
$url = route('en.about'); // /en/about
$url = route('en.about', [], true, 'nl'); // /nl/about
```

> **Note:** in a most practical scenario you would register a route either localized **or** non-localized, but not both. If you do, you will always need to specify a locale to get the URL, because non-localized routes always have priority when using the `route()` function.

### 🚌 Redirect to Routes

[](#-redirect-to-routes)

Laravel's `Redirector` uses the same `UrlGenerator` as the `route()` function behind the scenes. Because we are overriding this class, you can easily redirect to your routes.

```
return redirect()->route('home'); // non-localized route, redirects to /home
return redirect()->route('about'); // localized route, redirects to /en/about (current locale)
```

You can't redirect to URL's in a specific locale this way, but if you need to, you can of course just use the `route()` function.

```
return redirect(route('about', [], true, 'nl')); // localized route, redirects to /nl/about
```

### ⚓️ Generate Localized Versions of the Current URL

[](#️-generate-localized-versions-of-the-current-url)

To generate a URL for the current route in any locale, you can use this `Route` macro:

##### With Route Model Binding

[](#with-route-model-binding)

If your route uses a localized key (like a slug) and you are using [route model binding](#-route-model-binding), then the key will automatically be localized.

```
$current = \Route::localizedUrl(); // /en/posts/en-slug
$en = \Route::localizedUrl('en'); // /en/posts/en-slug
$nl = \Route::localizedUrl('nl'); // /nl/posts/nl-slug
```

If you have a route **with multiple keys**, like `/en/posts/{id}/{slug}`, then you can pass the parameters yourself (like in the example without route model binding below) or you can implement this interface in your model:

```
use CodeZero\LocalizedRoutes\ProvidesRouteParameters;
use Illuminate\Database\Eloquent\Model;

class Post extends Model implements ProvidesRouteParameters
{
    public function getRouteParameters($locale = null)
    {
        return [
            $this->id,
            $this->getSlug($locale) // Add this method yourself of course :)
        ];
    }
}
```

Now, as long as you use route model binding, you can still just do:

```
$current = \Route::localizedUrl(); // /en/posts/en-slug
$en = \Route::localizedUrl('en'); // /en/posts/en-slug
$nl = \Route::localizedUrl('nl'); // /nl/posts/nl-slug
```

##### Without Route Model Binding

[](#without-route-model-binding)

If you don't use [route model binding](#-route-model-binding) and you need a localized slug in the URL, then you will have to pass it manually.

For example:

```
$nl = \Route::localizedUrl('nl'); // Wrong: /nl/posts/en-slug
$nl = \Route::localizedUrl('nl', [$post->getSlug('nl')]); // Right: /nl/posts/nl-slug
```

The `getSlug()` method is just for illustration, so you will need to implement that yourself of course.

### ✍🏻 Generate Signed Route URL's

[](#-generate-signed-route-urls)

Generating a [signed route URL](https://laravel.com/docs/urls#signed-urls) is just as easy.

Pass it the route name, the necessary parameters and you will get the URL for the current locale.

```
$signedUrl = URL::signedRoute('reset.password', ['user' => $id], now()->addMinutes(30));
```

You can also generate a signed URL for a specific locale:

```
$signedUrl = URL::signedRoute($name, $parameters, $expiration, true, 'nl');
```

Check out the [Laravel docs](https://laravel.com/docs/urls#signed-urls) for more info on signed routes.

### 🌎 Translate Routes

[](#-translate-routes)

If you want to translate the segments of your URI's, create a `routes.php` language file for each locale you [configured](#%EF%B8%8F-supported-locales):

```
resources
 └── lang
      ├── en
      │    └── routes.php
      └── nl
           └── routes.php

```

In these files, add a translation for each segment, or for the full URI.

If an exact match is found, that will be returned. Otherwise, each segment will be translated separately. If a translation is not found, the original segment is used.

```
// lang/nl/routes.php
return [
    'glass' => 'glas',
    'products' => 'producten',
    'materials' => 'materiaal',
    'materials/glass' => 'materiaal/glazen'
];
```

Now you can use our `Lang::uri()` macro during route registration:

```
Route::localized(function () {

    Route::get(Lang::uri('products/glass'), ProductsController::class.'@index')
        ->name('products.glass');

    Route::get(Lang::uri('materials/glass'), MaterialsController::class.'@index')
        ->name('materials.glass');

});
```

The above will generate:

- /en/products/glass
- /nl/producten/glass
- /en/materials/glass
- /nl/materiaal/glazen

If you need to get a translation from a package, you can pass an optional translation namespace as a third parameter to `Lang::uri()`:

```
Route::localized(function () {

    Route::get(Lang::uri('products/glass', null, 'shop'), ProductsController::class.'@index')
        ->name('products.glass');

});
```

> Note that in order to find a translated version of a route, you will need to give your routes a name. If you don't name your routes, only the parameters (model route keys) will be translated, not the "hard-coded" slugs.

🚏 Route Parameters
------------------

[](#-route-parameters)

Parameter placeholders are not translated via language files. These are values you would provide via the `route()` function. The `Lang::uri()` macro will skip any parameter placeholder segment.

If you have a model that uses a route key that is translated in the current locale, then you can still simply pass the model to the `route()` function to get translated URL's.

An example...

**Given we have a model like this:**

```
class Post extends \Illuminate\Database\Eloquent\Model
{
    public function getRouteKey()
    {
        $slugs = [
            'en' => 'en-slug',
            'nl' => 'nl-slug',
        ];

        return $slugs[app()->getLocale()];
    }
}
```

> **TIP:** checkout [spatie/laravel-translatable](https://github.com/spatie/laravel-translatable) for translatable models.

**If we have a localized route like this:**

```
Route::localized(function () {

    Route::get('posts/{post}', PostsController::class.'@show')
        ->name('posts.show');

});
```

**We can now get the URL with the appropriate slug:**

```
app()->setLocale('en');
app()->getLocale(); // 'en'

$post = new Post;

$url = route('posts.show', [$post]); // /en/posts/en-slug
$url = route('posts.show', [$post], true, 'nl'); // /nl/posts/nl-slug
```

🚴‍ Route Model Binding
----------------------

[](#‍-route-model-binding)

If you enable the [middleware](#%EF%B8%8F-use-middleware-to-update-app-locale) included in this package, you can use [Laravel's route model binding](https://laravel.com/docs/routing#route-model-binding)to automatically inject models with localized route keys in your controllers.

All you need to do is add a `resolveRouteBinding()` method to your model. Check [Laravel's documentation](https://laravel.com/docs/routing#route-model-binding)for alternative ways to enable route model binding.

```
public function resolveRouteBinding($value)
{
    // Perform the logic to find the given slug in the database...
    return $this->where($this->getRouteKeyName().'->'.app()->getLocale(), $value)->firstOrFail();
}
```

Laravel 7 and newer has an optional `$field` parameter that allows you to override the route key on specific routes:

```
// Use the post slug as the route parameter instead of the default ID
Route::get('posts/{post:slug}', ...);
```

The new method would then look like this:

```
public function resolveRouteBinding($value, $field = null)
{
    // Perform the logic to find the given slug in the database...
    return $this->where($field ?? $this->getRouteKeyName().'->'.app()->getLocale(), $value)->firstOrFail();
}
```

> **TIP:** checkout [spatie/laravel-translatable](https://github.com/spatie/laravel-translatable) for translatable models.

🗃 Cache Routes
--------------

[](#-cache-routes)

In production you can safely cache your routes per usual.

```
php artisan route:cache
```

🚧 Testing
---------

[](#-testing)

```
composer test
```

☕️ Credits
----------

[](#️-credits)

- [Ivan Vermeyen](https://byterider.io)
- [All contributors](../../contributors)

🔓 Security
----------

[](#-security)

If you discover any security related issues, please [e-mail me](mailto:ivan@codezero.be) instead of using the issue tracker.

📑 Changelog
-----------

[](#-changelog)

A complete list of all notable changes to this package can be found on the [releases page](https://github.com/codezero-be/laravel-localized-routes/releases).

📜 License
---------

[](#-license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 88.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~72 days

Recently: every ~207 days

Total

22

Last Release

1429d ago

Major Versions

1.3.4 → 2.0.02019-12-17

PHP version history (3 changes)1.0.0PHP ^7.1

2.4.0PHP ^7.2.5

2.7.2PHP ^7.1|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/509a5baf8d7d8f7ae8c5b569ee81b1d04ed6af1af625696777e51e997ff9a685?d=identicon)[bumbummen99](/maintainers/bumbummen99)

---

Top Contributors

[![ivanvermeyen](https://avatars.githubusercontent.com/u/3598622?v=4)](https://github.com/ivanvermeyen "ivanvermeyen (186 commits)")[![bumbummen99](https://avatars.githubusercontent.com/u/4533331?v=4)](https://github.com/bumbummen99 "bumbummen99 (13 commits)")[![kedniko](https://avatars.githubusercontent.com/u/42846752?v=4)](https://github.com/kedniko "kedniko (2 commits)")[![Skullbock](https://avatars.githubusercontent.com/u/1104083?v=4)](https://github.com/Skullbock "Skullbock (2 commits)")[![lada](https://avatars.githubusercontent.com/u/179279?v=4)](https://github.com/lada "lada (1 commits)")[![mallardduck](https://avatars.githubusercontent.com/u/619938?v=4)](https://github.com/mallardduck "mallardduck (1 commits)")[![pascalbaljet](https://avatars.githubusercontent.com/u/8403149?v=4)](https://github.com/pascalbaljet "pascalbaljet (1 commits)")[![andrewnclark](https://avatars.githubusercontent.com/u/38881834?v=4)](https://github.com/andrewnclark "andrewnclark (1 commits)")[![WhiteWolf99](https://avatars.githubusercontent.com/u/1449365?v=4)](https://github.com/WhiteWolf99 "WhiteWolf99 (1 commits)")[![domgew](https://avatars.githubusercontent.com/u/44265359?v=4)](https://github.com/domgew "domgew (1 commits)")[![hfalucas](https://avatars.githubusercontent.com/u/7132610?v=4)](https://github.com/hfalucas "hfalucas (1 commits)")[![hlaCk](https://avatars.githubusercontent.com/u/27328114?v=4)](https://github.com/hlaCk "hlaCk (1 commits)")

---

Tags

phplaravellocalizationlanguageroutestranslationroutinglocalecountry

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/skyraptor-laravel-localized-routes/health.svg)

```
[![Health](https://phpackages.com/badges/skyraptor-laravel-localized-routes/health.svg)](https://phpackages.com/packages/skyraptor-laravel-localized-routes)
```

###  Alternatives

[codezero/laravel-localized-routes

A convenient way to set up, manage and use localized routes in a Laravel app.

543638.1k4](/packages/codezero-laravel-localized-routes)[opgginc/codezero-laravel-localized-routes

A convenient way to set up, manage and use localized routes in a Laravel app.

2770.1k1](/packages/opgginc-codezero-laravel-localized-routes)[codezero/laravel-localizer

Automatically detect and set an app locale that matches your visitor's preference.

50394.3k4](/packages/codezero-laravel-localizer)[awes-io/localization-helper

Package for convenient work with Laravel's localization features

3527.1k4](/packages/awes-io-localization-helper)[longman/laravel-multilang

Package to integrate multi language (multi locale) functionality in Laravel 5.x

5514.4k1](/packages/longman-laravel-multilang)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
