PHPackages                             taxionus/laravel-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. [Database &amp; ORM](/categories/database)
4. /
5. taxionus/laravel-translatable

ActiveLibrary[Database &amp; ORM](/categories/database)

taxionus/laravel-translatable
=============================

A trait to make an Eloquent model hold translations

1.0.0(3y ago)04MITPHPPHP ^8.0

Since Dec 16Pushed 3y ago1 watchersCompare

[ Source](https://github.com/taxionus/laravel-translatable)[ Packagist](https://packagist.org/packages/taxionus/laravel-translatable)[ Docs](https://github.com/taxionus/laravel-translatable)[ RSS](/packages/taxionus-laravel-translatable/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (6)Versions (2)Used By (0)

[![](https://camo.githubusercontent.com/2bedf63f24cda7efab02da955dc11fb7ef8a060e2f26b73c33a7aac84529b8a3/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f737570706f72742d756b7261696e652e7376673f743d31)](https://supportukrainenow.org)

A trait to make Eloquent models translatable
============================================

[](#a-trait-to-make-eloquent-models-translatable)

[![Latest Version on Packagist](https://camo.githubusercontent.com/8b7ccb2a9a6b64ac4ccc44259f2ef9bcfc233c35005dab53c6a4283945f629a4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746178696f6e75732f6c61726176656c2d7472616e736c617461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/taxionus/laravel-translatable)[![MIT Licensed](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![GitHub Workflow Status](https://camo.githubusercontent.com/644b1bc4be30acacfbd13ba5f7c28fe2e4063907ab37d7496487fcc7d3dd6d6e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f746178696f6e75732f6c61726176656c2d7472616e736c617461626c652f72756e2d74657374733f6c6162656c3d7465737473)](https://camo.githubusercontent.com/644b1bc4be30acacfbd13ba5f7c28fe2e4063907ab37d7496487fcc7d3dd6d6e/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f746178696f6e75732f6c61726176656c2d7472616e736c617461626c652f72756e2d74657374733f6c6162656c3d7465737473)[![Total Downloads](https://camo.githubusercontent.com/9088472beb1eb28b04ee2b85f79fcf36b3f0b7590750fea9d02455877002dc19/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746178696f6e75732f6c61726176656c2d7472616e736c617461626c652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/taxionus/laravel-translatable)

This package contains a trait to make Eloquent models translatable. Translations are stored as json. There is no extra table needed to hold them.

Once the trait is installed on the model you can do these things:

```
$newsItem = new NewsItem; // This is an Eloquent model
$newsItem
   ->setTranslation('name', 'en', 'Name in English')
   ->setTranslation('name', 'nl', 'Naam in het Nederlands')
   ->save();

$newsItem->name; // Returns 'Name in English' given that the current app locale is 'en'
$newsItem->getTranslation('name', 'nl'); // returns 'Naam in het Nederlands'

app()->setLocale('nl');

$newsItem->name; // Returns 'Naam in het Nederlands'
```

Support us
----------

[](#support-us)

[![](https://camo.githubusercontent.com/dc59c5caa4e0e03d95783ab3096e0e8922969e759f2e4cc017f11e5c825074b7/68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f6c61726176656c2d7472616e736c617461626c652e6a70673f743d31)](https://taxionus.be/github-ad-click/laravel-translatable)

We invest a lot of resources into creating [best in class open source packages](https://taxionus.be/open-source). You can support us by [buying one of our paid products](https://taxionus.be/open-source/support-us).

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on [our contact page](https://taxionus.be/about-us). We publish all received postcards on [our virtual postcard wall](https://taxionus.be/open-source/postcards).

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

[](#documentation)

All documentation is available [on our documentation site](https://taxionus.be/docs/laravel-translatable).

Testing
-------

[](#testing)

```
composer test
```

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

[](#contributing)

Please see [CONTRIBUTING](https://github.com/taxionus/.github/blob/main/CONTRIBUTING.md) for details.

Security
--------

[](#security)

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

Postcardware
------------

[](#postcardware)

You're free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.

Our address is: Taxionus, Kruikstraat 22, 2018 Antwerp, Belgium.

We publish all received postcards [on our company website](https://taxionus.be/en/opensource/postcards).

Credits
-------

[](#credits)

- [Freek Van der Herten](https://github.com/freekmurze)
- [Sebastian De Deyne](https://github.com/sebastiandedeyne)
- [All Contributors](../../contributors)

We got the idea to store translations as json in a column from [Mohamed Said](https://github.com/themsaid). Parts of the readme of [his multilingual package](https://github.com/themsaid/laravel-multilingual) were used in this readme.

License
-------

[](#license)

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

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

1297d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/66046717?v=4)[Ahamed Riham](/maintainers/ahamedriham)[@ahamedriham](https://github.com/ahamedriham)

---

Tags

translatemodeleloquentmultilinguallaravel-translatablei8ntaxionus

###  Code Quality

TestsPest

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-translatable

A trait to make an Eloquent model hold translations

2.5k26.4M533](/packages/spatie-laravel-translatable)[spatie/laravel-medialibrary

Associate files with Eloquent models

6.1k43.2M633](/packages/spatie-laravel-medialibrary)[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.4M96](/packages/mongodb-laravel-mongodb)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5022.0k](/packages/simplestats-io-laravel-client)

PHPackages © 2026

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