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

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

phpanonymous/laravel-translatable-12
====================================

A Laravel package for multilingual models upgrade by phpanonymous

12.0(1y ago)064MITPHPPHP ^8.2

Since Mar 12Pushed 1y agoCompare

[ Source](https://github.com/arabnewscms/laravel-translatable-12)[ Packagist](https://packagist.org/packages/phpanonymous/laravel-translatable-12)[ Docs](https://astrotomic.info)[ RSS](/packages/phpanonymous-laravel-translatable-12/feed)WikiDiscussions main Synced 3w ago

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

Introduction
============

[](#introduction)

[![Latest Version](https://camo.githubusercontent.com/9cdbc27c5c5b0bb4f970b967dc4075351fe88c9e8c7c05447b0c09b77f18d850/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f617374726f746f6d69632f6c61726176656c2d7472616e736c617461626c652e7376673f6c6162656c3d52656c65617365267374796c653d666f722d7468652d6261646765)](https://packagist.org/packages/astrotomic/laravel-translatable)[![MIT License](https://camo.githubusercontent.com/ed8aafe5cb92d36db04fd6fb8ef6b669f52c5a58e3e1fe9bf242b0cd8e3c410b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f417374726f746f6d69632f6c61726176656c2d7472616e736c617461626c652e7376673f6c6162656c3d4c6963656e736526636f6c6f723d626c7565267374796c653d666f722d7468652d6261646765)](https://github.com/Astrotomic/laravel-translatable/blob/master/LICENSE)[![Offset Earth](https://camo.githubusercontent.com/d204555ebe1fb0ae82d10c97b4f4ffc2dfdd2ba1489f98be7f7e8708333a0466/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f54726565776172652d2546302539462538432542332d677265656e3f7374796c653d666f722d7468652d6261646765)](https://plant.treeware.earth/Astrotomic/laravel-translatable)[![Larabelles](https://camo.githubusercontent.com/a2c8d5126ddd8c5ddc627176d1d2e0568f8399b50038e71fd7f774c3e24dbe4b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726162656c6c65732d2546302539462541362538342d6c6967687470696e6b3f7374796c653d666f722d7468652d6261646765)](https://www.larabelles.com/)

[![GitHub Workflow Status](https://camo.githubusercontent.com/2c41968b0b4a5eeb34d96e6ad9e6a91a05e669a319a5ea8a0bac711a0e41949a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f417374726f746f6d69632f6c61726176656c2d7472616e736c617461626c652f706870756e69742e796d6c3f7374796c653d666c61742d737175617265266c6f676f436f6c6f723d7768697465266c6f676f3d676974687562266c6162656c3d504850756e6974)](https://github.com/Astrotomic/laravel-translatable/actions?query=workflow%3Aphpunit)[![GitHub Workflow Status](https://camo.githubusercontent.com/bc884edc6af48dc1d6f636502de8b6c388e7411e74d0a136cd5fbf04c05d5c16/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f417374726f746f6d69632f6c61726176656c2d7472616e736c617461626c652f70696e742e796d6c3f7374796c653d666c61742d737175617265266c6f676f436f6c6f723d7768697465266c6f676f3d676974687562266c6162656c3d50696e74)](https://github.com/Astrotomic/laravel-translatable/actions?query=workflow%3Apint)[![Codecov Coverage](https://camo.githubusercontent.com/b6218ba08d93f90e4ee5244687e568736b4322bbbb331641aa422136edd63357/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f417374726f746f6d69632f6c61726176656c2d7472616e736c617461626c653f6c6f676f3d636f6465636f76266c6f676f436f6c6f723d7768697465266c6162656c3d436f6465636f76267374796c653d666c61742d737175617265)](https://codecov.io/gh/Astrotomic/laravel-translatable)[![Total Downloads](https://camo.githubusercontent.com/4a6417dee2fbd15479b31fc0666dbb309831c890af7d012e0e21d47ea82f3b78/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f617374726f746f6d69632f6c61726176656c2d7472616e736c617461626c652e7376673f6c6162656c3d446f776e6c6f616473267374796c653d666c61742d737175617265)](https://packagist.org/packages/astrotomic/laravel-translatable)[![GitBook](https://camo.githubusercontent.com/011412a630df92fdc201017b8f783e2920e411c986c8d1b7b1c91f77a2363404/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f476974426f6f6b2d417374726f746f6d69632d3765353763322e7376673f7374796c653d666c61742d737175617265)](https://docs.astrotomic.info/laravel-translatable)

 [![laravel-translatable socialcard](/art/socialcard.png)](/art/socialcard.png)

**If you want to store translations of your models into the database, this package is for you.**

This is a Laravel package for translatable models. Its goal is to remove the complexity in retrieving and storing multilingual model instances. With this package you write less code, as the translations are being fetched/saved when you fetch/save your instance.

The full documentation can be found at [GitBook](https://docs.astrotomic.info/laravel-translatable).

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

[](#installation)

```
composer require phpanonymous/laravel-translatable-12
```

Quick Example
-------------

[](#quick-example)

### **Getting translated attributes**

[](#getting-translated-attributes)

```
$post = Post::first();
echo $post->translate('en')->title; // My first post

App::setLocale('en');
echo $post->title; // My first post

App::setLocale('de');
echo $post->title; // Mein erster Post
```

### **Saving translated attributes**

[](#saving-translated-attributes)

```
$post = Post::first();
echo $post->translate('en')->title; // My first post

$post->translate('en')->title = 'My cool post';
$post->save();

$post = Post::first();
echo $post->translate('en')->title; // My cool post
```

### **Filling multiple translations**

[](#filling-multiple-translations)

```
$data = [
  'author' => 'Gummibeer',
  'en' => ['title' => 'My first post'],
  'fr' => ['title' => 'Mon premier post'],
];
$post = Post::create($data);

echo $post->translate('fr')->title; // Mon premier post
```

#### Filling multiple translations wrapped

[](#filling-multiple-translations-wrapped)

You may define a wrapper property when creating new translations. Set the `translations_wrapper` property in translatable config file:

```
'translations_wrapper' => 'translations',
```

Then just wrap multiple locales using that property:

```
$data = [
  'author' => 'Gummibeer',
  'translations' => [
      'en' => ['title' => 'My first post'],
      'fr' => ['title' => 'Mon premier post'],
  ],
];
$post = Post::create($data);

echo $post->translate('fr')->title; // Mon premier post
```

Tutorials
---------

[](#tutorials)

- [How To Add Multilingual Support to Eloquent](https://laravel-news.com/how-to-add-multilingual-support-to-eloquent)
- [How To Build An Efficient and SEO Friendly Multilingual Architecture For Your Laravel Application](https://mydnic.be/post/how-to-build-an-efficient-and-seo-friendly-multilingual-architecture-for-your-laravel-application)
- [How to Add Multi-Language Models to Laravel QuickAdminPanel](https://quickadminpanel.com/blog/how-to-add-multi-language-models-to-laravel-quickadminpanel/)

Changelog
---------

[](#changelog)

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

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

[](#contributing)

Please see [CONTRIBUTING](https://github.com/Astrotomic/.github/blob/master/CONTRIBUTING.md) for details. You could also be interested in [CODE OF CONDUCT](https://github.com/Astrotomic/.github/blob/master/CODE_OF_CONDUCT.md).

### Security

[](#security)

If you discover any security related issues, please check [SECURITY](https://github.com/Astrotomic/.github/blob/master/SECURITY.md) for steps to report it.

Credits
-------

[](#credits)

- [Tom Witkowski](https://github.com/Gummibeer) *current maintainer*
- [Dimitrios Savvopoulos](https://github.com/dimsav) *original author*
- [David Llop](https://github.com/Lloople) *refactoring testsuite*
- [Caneco](https://github.com/caneco) *artwork*
- [All Contributors](../../contributors)

Versions
--------

[](#versions)

PackageLaravelPHP**v11.13 - v11.15**`9.* / 10.* / 11.*``^8.0`**v11.12 - v11.12**`8.* / 9.* / 10.*``^8.0`**v11.10 - v11.11**`8.* / 9.*``^8.0`**v11.6 - v11.9**`5.8.* / 6.* / 7.* / 8.*``>=7.2`**v11.4 - v11.5**`5.6.* / 5.7.* / 5.8.* / 6.*``>=7.1.3`**v11.0 - v11.3**`5.6.* / 5.7.* / 5.8.*``>=7.1.3`Treeware
--------

[](#treeware)

You're free to use this package, but if it makes it to your production environment I would highly appreciate you buying the world a tree.

It’s now common knowledge that one of the best tools to tackle the climate crisis and keep our temperatures from rising above 1.5C is to [plant trees](https://www.bbc.co.uk/news/science-environment-48870920). If you contribute to my forest you’ll be creating employment for local families and restoring wildlife habitats.

You can buy trees at [offset.earth/treeware](https://plant.treeware.earth/Astrotomic/laravel-translatable)

Read more about Treeware at [treeware.earth](https://treeware.earth)

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance42

Moderate activity, may be stable

Popularity9

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 52.2% 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

Unknown

Total

1

Last Release

471d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4e69eb26372ee1008cb285858b579b1162bde21b3c6af6bc5e73505eb8ae89d5?d=identicon)[PhpAnonymous](/maintainers/PhpAnonymous)

---

Top Contributors

[![Gummibeer](https://avatars.githubusercontent.com/u/6187884?v=4)](https://github.com/Gummibeer "Gummibeer (584 commits)")[![dimsav](https://avatars.githubusercontent.com/u/1785686?v=4)](https://github.com/dimsav "dimsav (357 commits)")[![Lloople](https://avatars.githubusercontent.com/u/5665466?v=4)](https://github.com/Lloople "Lloople (27 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (26 commits)")[![netdown](https://avatars.githubusercontent.com/u/4265403?v=4)](https://github.com/netdown "netdown (15 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (14 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (13 commits)")[![sdebacker](https://avatars.githubusercontent.com/u/134503?v=4)](https://github.com/sdebacker "sdebacker (10 commits)")[![Oleksandr-Moik](https://avatars.githubusercontent.com/u/50796878?v=4)](https://github.com/Oleksandr-Moik "Oleksandr-Moik (8 commits)")[![johannesschobel](https://avatars.githubusercontent.com/u/9431350?v=4)](https://github.com/johannesschobel "johannesschobel (7 commits)")[![amjadbanimattar](https://avatars.githubusercontent.com/u/11890126?v=4)](https://github.com/amjadbanimattar "amjadbanimattar (7 commits)")[![ahmed-aliraqi](https://avatars.githubusercontent.com/u/23261109?v=4)](https://github.com/ahmed-aliraqi "ahmed-aliraqi (5 commits)")[![easteregg](https://avatars.githubusercontent.com/u/188798?v=4)](https://github.com/easteregg "easteregg (4 commits)")[![cbl](https://avatars.githubusercontent.com/u/29352871?v=4)](https://github.com/cbl "cbl (4 commits)")[![Hyleeh](https://avatars.githubusercontent.com/u/5340560?v=4)](https://github.com/Hyleeh "Hyleeh (3 commits)")[![caneco](https://avatars.githubusercontent.com/u/502041?v=4)](https://github.com/caneco "caneco (3 commits)")[![Tofandel](https://avatars.githubusercontent.com/u/6115458?v=4)](https://github.com/Tofandel "Tofandel (3 commits)")[![arabnewscms](https://avatars.githubusercontent.com/u/17859436?v=4)](https://github.com/arabnewscms "arabnewscms (3 commits)")[![rbngzlv](https://avatars.githubusercontent.com/u/2051199?v=4)](https://github.com/rbngzlv "rbngzlv (3 commits)")[![chrillep](https://avatars.githubusercontent.com/u/1267931?v=4)](https://github.com/chrillep "chrillep (3 commits)")

---

Tags

laravellanguagedatabasetranslation

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3345.1M337](/packages/psalm-plugin-laravel)[astrotomic/laravel-translatable

A Laravel package for multilingual models

1.4k8.0M135](/packages/astrotomic-laravel-translatable)[illuminate/database

The Illuminate Database package.

2.8k54.1M11.1k](/packages/illuminate-database)[laravel/ai

The official AI SDK for Laravel.

9782.1M162](/packages/laravel-ai)[spatie/laravel-health

Monitor the health of a Laravel application

87411.3M153](/packages/spatie-laravel-health)[watson/validating

Eloquent model validating trait.

9733.4M53](/packages/watson-validating)

PHPackages © 2026

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