PHPackages                             naoray/laravel-localizer - 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. naoray/laravel-localizer

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

naoray/laravel-localizer
========================

Tool to manage multiple language app

v2.0.0(5y ago)1413MITPHP

Since Oct 23Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Naoray/laravel-localizer)[ Packagist](https://packagist.org/packages/naoray/laravel-localizer)[ GitHub Sponsors](https://github.com/Naoray)[ RSS](/packages/naoray-laravel-localizer/feed)WikiDiscussions master Synced yesterday

READMEChangelog (5)Dependencies (4)Versions (8)Used By (0)

laravel-localizer
=================

[](#laravel-localizer)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Tests](https://github.com/naoray/laravel-localizer/workflows/Run%20Tests%20-%20Current/badge.svg?branch=master)](https://github.com/naoray/laravel-localizer/workflows/Run%20Tests%20-%20Current/badge.svg?branch=master)[![Total Downloads](https://camo.githubusercontent.com/0d64031a8ea34a602205f203979d7fe823f89481fc3ae8af35c45e844b41f3fa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e616f7261792f6c61726176656c2d6c6f63616c697a65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/naoray/laravel-localizer)

Easily detect the language of your user from `session`, `cookie`, `browser locale` or `app setting`. Change locale with a get request to `localizer::setLocale` and control which language version the user can see via `localizer` middleware.

This package is using [codezero/laravel-localizer](https://github.com/codezero-be/laravel-localizer) behind the scenes and extends its functionality to include:

- add Route `localizer::setLocale` for changing locales
- add Carbon store to get localized timestamps
- add Facade to use `allowedLocales()` method in views

Install
-------

[](#install)

`composer require naoray/laravel-localizer`

Publish config with `php artisan vendor:publish --provider="CodeZero\Localizer\LocalizerServiceProvider" --tag="config"`

Usage
-----

[](#usage)

### Add Supported Locales

[](#add-supported-locales)

Edit `supported-locales` array of the `localizer` config to include all allowed locales.

```
'supported-locales' => ['en', 'de']
```

### Add Carbon Store

[](#add-carbon-store)

Add `\Naoray\LaravelLocalizer\Stores\CarbonStore::class` to `localizerstores` to enable the carbon store and sync current locale with carbon locale.

```
'stores' => [
  CodeZero\Localizer\Stores\SessionStore::class,
  CodeZero\Localizer\Stores\CookieStore::class,
  CodeZero\Localizer\Stores\AppStore::class,
  Naoray\LaravelLocalizer\Stores\CarbonStore::class,
],
```

### Use Localizer in middleware

[](#use-localizer-in-middleware)

Add `localize` middleware to your web route in the `RouteServiceProvider`

```
//...
protected function mapWebRoutes()
{
    Route::middleware(['web', 'localize'])
          ->namespace($this->namespace)
          ->group(base_path('routes/web.php'));
}
```

Or simply add it as a middleware to your route groups.

### Add Change Locale routes in view

[](#add-change-locale-routes-in-view)

Add `Localizer` Facade to `app` config.

```
//...
'Localizer' => Naoray\LaravelLocalizer\Facades\LocalizerFacade::class,
```

In the view you can use `allowedLocales()` to get all allowed locales in the view.

```
@foreach (Localizer::allowedLocales() as $locale)
  {{ strtoupper($locale)}}
@endforeach
```

### Extend Functionalities

[](#extend-functionalities)

You can add new `stores` and `detectors` by implementing the corresponding interface. For more info visit [codezero/laravel-localizer](https://github.com/codezero-be/laravel-localizer#drivers)

Testing
-------

[](#testing)

Run the tests with:

```
vendor/bin/phpunit
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security-related issues, please email DummyAuthorEmail instead of using the issue tracker.

License
-------

[](#license)

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

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 89.3% 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 ~208 days

Total

5

Last Release

1924d ago

Major Versions

v1.0.3 → v2.0.02021-02-03

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10154100?v=4)[Krishan König](/maintainers/Naoray)[@Naoray](https://github.com/Naoray)

---

Top Contributors

[![Naoray](https://avatars.githubusercontent.com/u/10154100?v=4)](https://github.com/Naoray "Naoray (25 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (3 commits)")

---

Tags

languagelaravellocalizationmiddlewarepackagelaravellanguagelocalizer

### Embed Badge

![Health badge](/badges/naoray-laravel-localizer/health.svg)

```
[![Health](https://phpackages.com/badges/naoray-laravel-localizer/health.svg)](https://phpackages.com/packages/naoray-laravel-localizer)
```

###  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)[vluzrmos/language-detector

Detect the language for your application using browser preferences, subdomains or route prefixes.

109554.8k3](/packages/vluzrmos-language-detector)[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)[longman/laravel-multilang

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

5514.4k1](/packages/longman-laravel-multilang)[highsolutions/laravel-translation-manager

Manage Laravel Translations

1518.8k](/packages/highsolutions-laravel-translation-manager)[awes-io/localization-helper

Package for convenient work with Laravel's localization features

3527.1k4](/packages/awes-io-localization-helper)

PHPackages © 2026

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