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

ActiveLaravel-package[Database &amp; ORM](/categories/database)

latevaweb/laravel-translatable
==============================

Laravel package to make Eloquent models attributes translatables

0.1.9(1y ago)01.1k2[4 issues](https://github.com/latevaweb/laravel-translatable/issues)[4 PRs](https://github.com/latevaweb/laravel-translatable/pulls)MITPHPPHP ^7.3|^8.2|^8.3

Since Dec 20Pushed 1y ago1 watchersCompare

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

READMEChangelog (4)Dependencies (2)Versions (19)Used By (0)

Laravel Translatable
====================

[](#laravel-translatable)

Make Eloquent model attributes translatables using Translations table

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/81003575a6c2693e094e3367b41c8d42ad59a23c02b2c4b00b22c784650fadda/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c61746576617765622f6c61726176656c2d7472616e736c617461626c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/latevaweb/laravel-translatable/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/6d16b7e1382aaf5dfd7a6fe730d1bc54135e7c089915bb4a6302979954018896/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c61746576617765622f6c61726176656c2d7472616e736c617461626c652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/latevaweb/laravel-translatable/?branch=master)[![Build Status](https://camo.githubusercontent.com/3b56a7405504d40b4c61d203890ee14be7451fce4cebe82a025661b378ee9ee9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c61746576617765622f6c61726176656c2d7472616e736c617461626c652f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/latevaweb/laravel-translatable/build-status/master)[![StyleCI](https://camo.githubusercontent.com/286d26b3f84e06cf0dfe014979e7809a4ee42b366e9957341de47294a6b1e72f/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3232393234363133302f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/229246130)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)[![Laravel 6.x](https://camo.githubusercontent.com/8333c1fae9a342ecc33e082cf504539043e98f24028a9df0513db89db6a82d1b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d362e782d6f72616e67652e737667)](http://laravel.com)

This package contains a trait to make Eloquent attributes translatable. Translations are stored in Translations database table.

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

```
$customer = new Customer; // An Eloquent model
$customer
   ->setTranslation('greeting', 'en', 'Hello')
   ->setTranslation('greeting', 'es', 'Hola')
   ->save();

$customer->greeting; // Returns 'Hello' given that the current app locale is 'en'
$customer->getTranslation('greeting', 'es'); // returns 'Hola'

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

$customer->greeting; // Returns 'Hola'
```

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

[](#installation)

You can install the package via composer:

```
composer require latevaweb/laravel-translatable
```

If you want to change the default model or the default tables names, you could publish the config file:

```
php artisan vendor:publish --provider="LaTevaWeb\Translatable\TranslatableServiceProvider" --tag=config --force
```

You must publish the migration file to create polymorphic and main translations tables:

```
php artisan vendor:publish --provider="LaTevaWeb\Translatable\TranslatableServiceProvider" --tag=migrations --force
```

Making a model translatable
---------------------------

[](#making-a-model-translatable)

The required steps to make a model translatable are:

- First, you need to add the `LaTevaWeb\Translatable\Traits\Translatable`-trait.
- Next, you should create a public static property `$translatable` which holds an array with all the names of attributes you wish to make translatable.
- You have to create a field in the migration of your model type `string` and `nullable`.

Here's an example of a prepared model:

```
use Illuminate\Database\Eloquent\Model;
use LaTevaWeb\Translatable\Traits\Translatable;

class NewsItem extends Model
{
    use Translatable;

    protected $fillable = ['greeting'];
    public static $translatable = ['greeting'];
}
```

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity71

Established project with proven stability

 Bus Factor1

Top contributor holds 87.5% 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 ~187 days

Recently: every ~398 days

Total

10

Last Release

646d ago

PHP version history (2 changes)0.1.0PHP ^7.3

0.1.9PHP ^7.3|^8.2|^8.3

### Community

Maintainers

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

---

Top Contributors

[![latevaweb](https://avatars.githubusercontent.com/u/51783643?v=4)](https://github.com/latevaweb "latevaweb (14 commits)")[![rafaltw](https://avatars.githubusercontent.com/u/52454631?v=4)](https://github.com/rafaltw "rafaltw (1 commits)")[![rafatga](https://avatars.githubusercontent.com/u/3813277?v=4)](https://github.com/rafatga "rafatga (1 commits)")

---

Tags

laravellocalizationpackagetranslatabletranslationslaravellocalizationtranslationseloquenttranslatable

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

PHPackages © 2026

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