PHPackages                             rohit/laravel-localization - 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. rohit/laravel-localization

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

rohit/laravel-localization
==========================

localization for Laravel framework

1.1.0(8y ago)244MITPHPPHP &gt;=5.5.9

Since Jun 10Pushed 8y agoCompare

[ Source](https://github.com/rohitsubedi/laravel-localization)[ Packagist](https://packagist.org/packages/rohit/laravel-localization)[ Docs](https://github.com/rohitsubedi/laravel-localization)[ RSS](/packages/rohit-laravel-localization/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (3)Versions (5)Used By (0)

Laravel localization
====================

[](#laravel-localization)

Very easy and light package for loclization. Routing based on available locales and easy to get rid of default language prefix from route

Installation
------------

[](#installation)

### Composer

[](#composer)

Add Laravel Localization to your composer.json file

```
"rohit/laravel-localization": "^1.0"

```

Run `composer install` to get the latest version of package

Or you can directly run the `composer require` command

```
composer require rohit/laravel-localization

```

### Configuration

[](#configuration)

After the package install is completed you need to configure `config/app.php` and add `Providers` and `Aliases`

```
    'providers` => [
        .......
        .......
        Rohit\LaravelLocalization\LaravelLocalizationServiceProvider::class
    ]
```

```
    'aliases' => [
        ......
        ......
        'Localization' => Rohit\LaravelLocalization\Facades\LaravelLocalization::class
    ]
```

### Vendor Publish

[](#vendor-publish)

After the above steps, you need to publish vendor for this packge. It will create `laravel-localization.php` file under `config` folder. This folder contains the configuration for your locales.

```
php artisan vendor:publish --provider="Rohit\LaravelLocalization\LaravelLocalizationServiceProvider"

```

The file `laravel-localization.php` will contain the following structure

```
    return [
        // Add any language you want to support and comes as prefix in the url
        'all_locales' => [
            'en',
            'th'
        ],
        'default_locale' => 'th', // Default locale will not be shown in the url
    ];
```

Here you can add as many locales available in your project and set the `default_locale` to the value for which you want to exclude the prefix

**NOTE:** You can keep this field blank if you want all prefix in th url

**For Example:**

If your project has `en` and `th` as the available locales and if you set `th` as your default locale. Then the url will look like,

*For English:* `http://your_domain.com/en/your_page`

*For Thai* `http://your_domain.com/your_page`

It will skip default locale `th` from the url

### Middleware

[](#middleware)

After this, you need to update the `app\Http\Kernel.php` file and add the following line under `routeMiddleware`

```
    protected $routeMiddleware = [
        ........
        ........
        'localization' => \Rohit\LaravelLocalization\Middleware\LanguageHandler::class,
    ]
```

### Routing

[](#routing)

Finally you can manage all the routes with this configuration and middleware for smooth operation

Update `app\Http\routes.php` file and add all your routes under this group

```
    Route::group([
        'prefix' => Localization::setLocale(),
        'middleware' => ['localization']
    ], function() {
        // All your routes here
    });
```

### Helpers

[](#helpers)

There is a helper function to get the url for language switcher on the current page. You simply need to call a function with the `locale`

```
Localization::getLocaleUrl('en')

```

###  Health Score

28

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~124 days

Total

4

Last Release

3198d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a166b313d7c600a2d045a399b324eabf9b2d058776aee69363247e8fcc482433?d=identicon)[rohitsubedi](/maintainers/rohitsubedi)

---

Top Contributors

[![rohitsubedi](https://avatars.githubusercontent.com/u/4637059?v=4)](https://github.com/rohitsubedi "rohitsubedi (13 commits)")

---

Tags

phplaravellocalization

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rohit-laravel-localization/health.svg)

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

###  Alternatives

[codezero/laravel-localized-routes

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

541629.5k3](/packages/codezero-laravel-localized-routes)[josiasmontag/laravel-redis-mock

This Laravel package provides a Redis mock for your tests

471.7M15](/packages/josiasmontag-laravel-redis-mock)[awes-io/localization-helper

Package for convenient work with Laravel's localization features

3527.1k1](/packages/awes-io-localization-helper)[opgginc/codezero-laravel-localized-routes

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

2151.3k1](/packages/opgginc-codezero-laravel-localized-routes)[josiasmontag/laravel-localization

Localization for Laravel framework

2336.1k](/packages/josiasmontag-laravel-localization)[laurentesc/laravel-subdomain-localization

Subdomain localization support for Laravel

1911.3k](/packages/laurentesc-laravel-subdomain-localization)

PHPackages © 2026

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