PHPackages                             thejano/laravel-multi-lang - 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. thejano/laravel-multi-lang

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

thejano/laravel-multi-lang
==========================

Polymorphic translation support for Laravel models with caching, helpers, and facade.

2.1.0(6mo ago)413MITPHPPHP &gt;=8.1CI passing

Since Nov 10Pushed 6mo agoCompare

[ Source](https://github.com/thejano/laravel-multi-lang)[ Packagist](https://packagist.org/packages/thejano/laravel-multi-lang)[ Docs](https://multi-lang.thejano.com)[ RSS](/packages/thejano-laravel-multi-lang/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (7)Versions (4)Used By (0)

Laravel Multi-Lang
==================

[](#laravel-multi-lang)

[![Latest Version on Packagist](https://camo.githubusercontent.com/10fe233166f74704644ec4800ecd21032ccd0d690ecacf0c03a00dfff62973bb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7468656a616e6f2f6c61726176656c2d6d756c74692d6c616e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/thejano/laravel-multi-lang)[![Tests](https://github.com/thejano/laravel-multi-lang/actions/workflows/tests.yml/badge.svg)](https://github.com/thejano/laravel-multi-lang/actions/workflows/tests.yml)[![Total Downloads](https://camo.githubusercontent.com/3463fd5a4c9e3be3aadb9287dc1ee3928cdb4c16392e0ca963ad227232098c72/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7468656a616e6f2f6c61726176656c2d6d756c74692d6c616e672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/thejano/laravel-multi-lang)[![License](https://camo.githubusercontent.com/f35f9aa474f3d100b4583f608b65f3a7e0051062f80d0677d3e2c291b74358a5/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7468656a616e6f2f6c61726176656c2d6d756c74692d6c616e672e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Polymorphic translations for Laravel models with a batteries-included developer experience—helper functions, eager-loading scopes, caching, CLI tooling, pluralisation helpers, import/export pipelines, and more.

Documentation
-------------

[](#documentation)

Visit docs for the complete guide—including Overview, Core Concepts, Querying Translations, Automation &amp; CLI, Extensibility, Middleware, and Testing.

---

Requirements
------------

[](#requirements)

- PHP 8.1 or higher
- Laravel 10.x, 11.x, or 12.x
- Database with JSON or text column support (MySQL, PostgreSQL, SQLite, etc.)

---

Why you’ll love it
------------------

[](#why-youll-love-it)

- **Laravel-native ergonomics** – fluent query scopes, helpers, Blade directives, and facades.
- **Performance ready** – eager loading, translation caching (including Redis-backed stores), and grouped predicates.
- **Robust workflows** – soft deletes with automatic restoration, batch setters, JSON import/export, audit command, pluralisation helpers.

---

Install
-------

[](#install)

```
composer require thejano/laravel-multi-lang

php artisan vendor:publish --tag=multi-lang-config
php artisan vendor:publish --tag=multi-lang-migrations
php artisan migrate
```

---

Five-minute setup
-----------------

[](#five-minute-setup)

```
use Illuminate\Database\Eloquent\Model;
use TheJano\MultiLang\Traits\Translatable;

class Post extends Model
{
    use Translatable;

    protected $fillable = ['title', 'content'];
    protected array $translatableFields = ['title', 'content'];
}
```

```
$post = Post::create(['title' => 'Original Title']);

$post->setTranslation('title', 'ناونیشان', 'ckb');
$post->translate('title', 'ckb');                      // ناونیشان
$post->translateOrOriginal('title', 'fr');             // Falls back to original value
trans_model_choice($post, 'visits', 5, ['count' => 5]);
```

Query like native Laravel:

```
Post::whereTranslate('title', 'ناونیشان', 'ckb')->get();
Post::whereTranslateWithFallback('title', 'عنوان', 'ckb', 'ar')->get();
Post::withTranslations(['ckb', 'ar'])->get();
```

---

CLI &amp; automation
--------------------

[](#cli--automation)

- `php artisan multi-lang:audit` – surface missing translations.
- `php artisan multi-lang:export` – JSON export (use `--missing`, `--ids`, `--locales`).
- `php artisan multi-lang:import` – merge/replace import with `--only-missing` support.

Pair exports/imports with your favourite translation service or CI workflow.

---

Caching tips
------------

[](#caching-tips)

Translations cache per model and can share stores:

```
'cache_store' => [
    'driver' => 'redis',    // null uses default cache store
    'prefix' => 'multi_lang:translations',
    'ttl'    => 3600,
],
```

Reset across tests/jobs with `Post::resetTranslationCacheStore();`.

---

Testing &amp; contributing
--------------------------

[](#testing--contributing)

- Run the Pest suite: `composer test`
- Issues or pull requests welcome—add tests and a short summary when contributing.
- Security reports:

---

License
-------

[](#license)

Laravel Multi-Lang is open-source software licensed under the [MIT license](LICENSE).

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance69

Regular maintenance activity

Popularity12

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 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 ~0 days

Total

3

Last Release

182d ago

Major Versions

1.0.0 → 2.0.02025-11-10

### Community

Maintainers

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

---

Top Contributors

[![drpshtiwan](https://avatars.githubusercontent.com/u/6718949?v=4)](https://github.com/drpshtiwan "drpshtiwan (15 commits)")

---

Tags

laravellocalizationi18ntranslationarabicmulti-langckb

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/thejano-laravel-multi-lang/health.svg)

```
[![Health](https://phpackages.com/badges/thejano-laravel-multi-lang/health.svg)](https://phpackages.com/packages/thejano-laravel-multi-lang)
```

###  Alternatives

[longman/laravel-multilang

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

5514.4k1](/packages/longman-laravel-multilang)[smousss/laravel-globalize

Make Laravel projects translatable in a matter of seconds!

2266.3k](/packages/smousss-laravel-globalize)

PHPackages © 2026

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