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

ActiveLibrary

mmidu/translatable
==================

Automatic translation of json multilingual fields for Laravel.

032PHP

Since Apr 10Pushed 6y ago1 watchersCompare

[ Source](https://github.com/mmidu/translatable)[ Packagist](https://packagist.org/packages/mmidu/translatable)[ RSS](/packages/mmidu-translatable/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

translatable
============

[](#translatable)

Automatic translation of json multilingual fields for Laravel.

usage:

1. add the service provider to config/app.php in the "providers" array like this. 'providers' =&gt; \[ ... Mmidu\\Translatable\\TranslatableServiceProvider::class, ... \],

    refresh the config cache with the command

    php artisan config:cache

    and publish the config file with the command

    php artisan vendor:publish --provider "Mmidu\\Translatable\\TranslatableServiceProvider"
2. use the Translatable trait to the model you want to use it for.
3. set the languages config in the config/translatable.php file, you can add and remove locales.
4. the locale used for the translation has to be put in the session.
5. add the translatable fields in the model's translatable attribute like this

    protected $translatable = \[ 'name', 'description' \];
6. the translatable fields must be JSON with the following structure:

    { "it": "nome", "en": "name", "es": "nombre" etc... }
7. access the right locale version through $model-&gt;attribute automatically.

    es. Session::put('locale', 'es'); echo $model-&gt;name;

    result = 'nombre'
8. Translatable adds two virtual attributes, multilingual\_attribute and mulitilingual\_attribute\_str which give the multilingual version of the translatable attributes in array version. multilingual\_attribute gives \[\] if there are no values, multilingual\_attribute\_str gives an empty string.
9. Enjoy!

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 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.

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

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

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

PHPackages © 2026

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