PHPackages                             cloudmonitor/translatable - 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. cloudmonitor/translatable

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

cloudmonitor/translatable
=========================

Translate model attributes into any number of languages.

v1.0.18(2y ago)1406[1 issues](https://github.com/CloudMonitorApp/Translatable/issues)MITPHPPHP ^7.2.5|^8.0

Since Sep 1Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/CloudMonitorApp/Translatable)[ Packagist](https://packagist.org/packages/cloudmonitor/translatable)[ RSS](/packages/cloudmonitor-translatable/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (1)Versions (21)Used By (0)

Translate Eloquent attributes into multiple languages and use `getLocale()` to seamlessly query the right translation.

### Install

[](#install)

```
composer require cloudmonitor/translatable
```

### Prepare Eloquent models

[](#prepare-eloquent-models)

Similar to other special attributes in Eloquent, such as `$fillables`, translatable attributes must be defined as an array. It is as simple as giving the name of the database column:

```
protected $translatable = [
    'name',
];
```

Translatable will now only be observing these attributes and skip the rest.

### Using translations

[](#using-translations)

As Translatable uses Laravels `app()->getLocale()` it means it will figure out which language to use when you query name.

For instance, your locale is currently `da` (Danish), so you want to update a book title. Simply do it as there was no translation implementation:

```
$book = Book::find($id);
$book->name = 'New name for Danish version';
$book->save();
```

Or as an update method:

```
Book::find($id)->update(['name' => 'New name for Danish version']);
```

Similar when you want to get the name in the current locale you simply query it:

```
return Book::find($id)->name;
```

#### Other locales

[](#other-locales)

Sometimes you want to update all translations or in a specific language or simply in a different than you are using. It could be a Danish moderator who wants to update the English title, titles for several languages, or something different.

```
Book::find($id)->setTranslation('name', 'en', 'Name in English');
```

Similarly, a specific language can be queried:

```
Book::find($id)->getTranslation('name', 'en');
```

### Order By translated columns

[](#order-by-translated-columns)

Since the build-in `->orderBy()` won't work as the data is stored in JSON format, an optimized `->orderByTranslation()` has been added.

First parameter is column name, second will be direction and third locale. Only first column is required.

```
Book::orderByTranslation('name', 'asc', 'en');
```

### Migrations

[](#migrations)

Behind the scenes Translatable uses `JSON` columns in the database to store multiple versions in the same column:

```
$table->json('name');
```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity65

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

Recently: every ~229 days

Total

20

Last Release

520d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8abc4e5efad297fa914e9cd42ab031ca84d024bd6c6fd2c658b665cc84846d93?d=identicon)[cloudmonitor](/maintainers/cloudmonitor)

---

Top Contributors

[![EmilMoe](https://avatars.githubusercontent.com/u/555083?v=4)](https://github.com/EmilMoe "EmilMoe (30 commits)")

---

Tags

laravellocalization

### Embed Badge

![Health badge](/badges/cloudmonitor-translatable/health.svg)

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

###  Alternatives

[kkomelin/laravel-translatable-string-exporter

Translatable String Exporter for Laravel

3291.4M10](/packages/kkomelin-laravel-translatable-string-exporter)[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)[erag/laravel-lang-sync-inertia

A powerful Laravel package for syncing and managing language translations across backend and Inertia.js (Vue/React) frontends, offering effortless localization, auto-sync features, and smooth multi-language support for modern Laravel applications.

3812.2k](/packages/erag-laravel-lang-sync-inertia)[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)
