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

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

javaabu/translatable
====================

Adds multi-lingual to Laravel models

v2.12.0(1mo ago)01.3k1MITPHPPHP ^8.2CI passing

Since Feb 25Pushed 1mo ago2 watchersCompare

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

READMEChangelog (5)Dependencies (10)Versions (54)Used By (1)

Translatable
============

[](#translatable)

[![Latest Version on Packagist](https://camo.githubusercontent.com/bcfd5f0fb89b030a91e4e6ef0a5a50334017d0ccf5d1413f160dad6b48facdd7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6176616162752f7472616e736c617461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/javaabu/translatable)[![Test Status](../../actions/workflows/run-tests.yml/badge.svg)](../../actions/workflows/run-tests.yml)[![Total Downloads](https://camo.githubusercontent.com/827673406de8de7b7c1515cfc51bc591238b5a67c7d66f7b3c12969414e8263e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6176616162752f7472616e736c617461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/javaabu/translatable)[![Code Coverage](./.github/coverage.svg)](./.github/coverage.svg)

Adds multi-lingual to Laravel models

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

[](#installation)

You can install the package via composer:

```
composer require javaabu/translatable
```

Usage
-----

[](#usage)

To get started with this package, you can simply add `$table->dbTranslatable();` or `$table->jsonTranslatable();` to your migration `up` function.

```
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Javaabu\Translatable\DbTranslatable\DbTranslatableSchema;

return new class extends Migration {
    public function up(): void
    {
        Schema::create('posts', function (Blueprint $table) {
            $table->id();

            // ...

            $table->dbTranslatable();
            // OR
            $table->jsonTranslatable();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('posts');
    }
};
```

And then all you need to do is add the `Translatable` implementation using the `IsDbTranslatable` or `IsJsonTranslatable` trait.

```
...

class Post extends Model implements Translatable
{
    use IsDbTranslatable;
    // OR
    use IsJsonTranslatable;

...
```

Now, your models will automatically be translated according to the current `app()->getLocale()`.

```
app()->setLocale('en');
$post->title // This is an English title

app()->setLocale('dv');
$post->title // Mee dhivehi title eh

$post->title_en // This is an English title
$post->title_dv // Mee dhivehi title eh
```

To add different translations, all you need to do is

```
// to add title for dv language
$post->title_dv = "Mee Dhivehi title eh";
```

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

[](#documentation)

You'll find the documentation on .

Find yourself stuck using the package? Found a bug? Do you have general questions or suggestions for improving this package? Feel free to create an [issue](../../issues) on GitHub, we'll try to address it as soon as possible.

If you've found a bug regarding security please mail  instead of using the issue tracker.

Testing
-------

[](#testing)

You can run the tests with

```
./vendor/bin/phpunit
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

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

Credits
-------

[](#credits)

- [Javaabu Pvt. Ltd.](https://github.com/javaabu)
- [Arushad Ahmed (@dash8x)](http://arushad.com)
- [Xylam (@Xylam)](https://github.com/Xylam)
- [FlameXode (@WovenCoast)](https://github.com/WovenCoast)
- [Athfan Khaleel (@athphane)](https://athfan.com)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

50

—

FairBetter than 96% of packages

Maintenance89

Actively maintained with recent releases

Popularity18

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Recently: every ~44 days

Total

52

Last Release

57d ago

Major Versions

v1.13.0 → v2.0.02025-07-23

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6671720?v=4)[Arushad Ahmed](/maintainers/dash8x)[@dash8x](https://github.com/dash8x)

![](https://avatars.githubusercontent.com/u/31658513?v=4)[Javaabu](/maintainers/javaabu)[@Javaabu](https://github.com/Javaabu)

![](https://www.gravatar.com/avatar/9923d6c384b4a474b02145530dbabe4daf52419c9147dc6aac42482dc52071cb?d=identicon)[xylam](/maintainers/xylam)

---

Top Contributors

[![athphane](https://avatars.githubusercontent.com/u/13810742?v=4)](https://github.com/athphane "athphane (81 commits)")[![WovenCoast](https://avatars.githubusercontent.com/u/44475239?v=4)](https://github.com/WovenCoast "WovenCoast (78 commits)")[![dash8x](https://avatars.githubusercontent.com/u/6671720?v=4)](https://github.com/dash8x "dash8x (9 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (8 commits)")[![muhammedjailam](https://avatars.githubusercontent.com/u/9347984?v=4)](https://github.com/muhammedjailam "muhammedjailam (2 commits)")

---

Tags

laraveltranslatablejavaabu

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[outl1ne/nova-translatable

A laravel-translatable extension for Laravel Nova.

203416.9k8](/packages/outl1ne-nova-translatable)[sertxudeveloper/laravel-translatable

Manage localized routes and use translatable models in a Laravel app.

183.6k](/packages/sertxudeveloper-laravel-translatable)[kerigard/laravel-lang-ru

Ru lang for Laravel

2116.8k](/packages/kerigard-laravel-lang-ru)[highsolutions/laravel-translation-manager

Manage Laravel Translations

1518.8k](/packages/highsolutions-laravel-translation-manager)

PHPackages © 2026

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