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

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

adamibrahim/localization
========================

Laravel 5.6 Localization package with language chooser

v0.2.8(8y ago)1158MITPHPPHP ~5.6|~7.0

Since Feb 18Pushed 8y agoCompare

[ Source](https://github.com/adamibrahim/localization)[ Packagist](https://packagist.org/packages/adamibrahim/localization)[ Docs](https://github.com/adamibrahim/localization)[ RSS](/packages/adamibrahim-localization/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (3)Versions (28)Used By (0)

Laravel 5.6 Localization package
================================

[](#laravel-56-localization-package)

[![Latest Version on Packagist](https://camo.githubusercontent.com/e47b5fd9742cd16674bc5afeaa5b2f8bbeaffeefff552eff13cdeb1468536d2b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f3a76656e646f722f3a7061636b6167655f6e616d652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/adamibrahim/localization)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/cb11179311e640818ab161382ab46616c3056e3374c94f90fdc6d06a309cf73b/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f3a76656e646f722f3a7061636b6167655f6e616d652f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/:vendor/:package_name)[![Coverage Status](https://camo.githubusercontent.com/77bd9748066a4737af2be4a15b71865967905bfc6aa38aabed0996acb7fb2bbb/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f3a76656e646f722f3a7061636b6167655f6e616d652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/:vendor/:package_name/code-structure)[![Quality Score](https://camo.githubusercontent.com/5ea237d9c7d6af5499007b76e317965f8bdfa4596fd71c22cd7fe2cb818594cc/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f3a76656e646f722f3a7061636b6167655f6e616d652e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/:vendor/:package_name)[![Total Downloads](https://camo.githubusercontent.com/2e7d96ffc3c5f08e269c45f38de91ce489968312df30848d817105c5ada0d9cc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f3a76656e646f722f3a7061636b6167655f6e616d652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/adamibrahim/localization)

Laravel 5.6 Localization package with

- Language chooser
- Different language sessions for website and CMS / back
- List of languages stored at Database table languages
- At table languages you can set boolean values for \[active, default\]

Demo
----

[](#demo)

You can see working [demo](http://admin.hostato.com)

Install
-------

[](#install)

##### Install the package Via Composer

[](#install-the-package-via-composer)

```
$ composer require adamibrahim/localization
```

##### If you installing at laravel 5.5 or higher then you may go directly to Publish other wise you will need to edit composer.json, register the Service Provider and middleware

[](#if-you-installing-at-laravel-55-or-higher-then-you-may-go-directly-to-publish-other-wise-you-will-need-to-edit-composerjson-register-the-service-provider-and-middleware)

### composer.json

[](#composerjson)

Add this code to your composer.json under the autoload at your main directory

```
"psr-4": {
            "Adam\\Localization\\": "vendor/adamibrahim/localization/src"
        }
```

### Service Provider

[](#service-provider)

At file config/app.php register service provider under \* Package Service Providers...

```
Adam\Localization\LocalizationServiceProvider::class,
```

##### Middleware

[](#middleware)

if you are using Laravel version lower than 5.5 then you need to register the lang middleware at your App\\Http\\Kernel.php

- At protected $routeMiddleware = \[ \] array add the below code

```
'lang' => \Adam\Localization\Middleware\Localization::class,
```

### Publishing

[](#publishing)

Optional publishing flags folder with flags svg images / and config file

```
$ php artisan vendor:publish --tag=Localization --force
```

### Database Migrating

[](#database-migrating)

run the Artisan migration command

```
$ php artisan migrate
```

### Seeding

[](#seeding)

Run the Artisan Seeding command

```
$ php artisan db:seed --class=Adam\Localization\database\seeds\LanguagesTableSeeder
```

### Artisan Seed Error

[](#artisan-seed-error)

If you receive this Error:

###### Class Adam\\Localization\\database\\seeds\\LanguagesTableSeeder does not exist

[](#class-adamlocalizationdatabaseseedslanguagestableseeder-does-not-exist)

Then you may need to dump-autoload by running this command

```
$ composer dump-autoload
```

Then run the seeding command once again

```
$ php artisan db:seed --class=Adam\Localization\database\seeds\LanguagesTableSeeder
```

### Usage

[](#usage)

You need to add 'lang' middleware to all your routes

```
->middleware('lang')
```

Add the Bootstrap language change buttons to your website page/s

```
@if (($languages)->count() > 1)

             {{ $lang['abbr'] }}

            @foreach($languages as $language)

                     {{$language->native}}

            @endforeach

@endif
```

Optional you can add different language session if needed for example admin control panel

```
@if (($languages_back)->count() > 1)

             {{ $lang_back['abbr'] }}

            @foreach($languages_back as $language)

                     {{$language->native}}

            @endforeach

@endif
```

Optional The lang\_back session set the app locale if the rote prefix is 'admin' if you wish to change the route prefix simple modify prefix at the config file config\\localization.php

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

[](#contributing)

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

[](#contributing-1)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email :author\_email instead of using the issue tracker.

Credits
-------

[](#credits)

- [Hostato](http://wwww.hostato.com)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 74.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 ~1 days

Total

27

Last Release

2980d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4f504cb40ae3721c41864e01cbc6742fef3dbed740e3f2672a003f6193d8dd6d?d=identicon)[adamibrahim](/maintainers/adamibrahim)

---

Top Contributors

[![hostato](https://avatars.githubusercontent.com/u/34839078?v=4)](https://github.com/hostato "hostato (23 commits)")[![adamibrahim](https://avatars.githubusercontent.com/u/21137009?v=4)](https://github.com/adamibrahim "adamibrahim (8 commits)")

---

Tags

localizationpackageLaravel 5.6language chooser

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

###  Alternatives

[kkomelin/laravel-translatable-string-exporter

Translatable String Exporter for Laravel

3291.4M10](/packages/kkomelin-laravel-translatable-string-exporter)[themsaid/laravel-langman

Manage language files with ease.

871307.5k11](/packages/themsaid-laravel-langman)[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)[outhebox/laravel-translations

Manage your Laravel translations with a beautiful UI. Add, edit, delete, import, and export translations with ease.

80687.6k](/packages/outhebox-laravel-translations)[chinleung/laravel-multilingual-routes

A package to register multilingual routes.

442195.4k2](/packages/chinleung-laravel-multilingual-routes)[tio/laravel

Add this package to localize your Laravel application (PHP, JSON or GetText).

170318.5k](/packages/tio-laravel)

PHPackages © 2026

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