Skip to content
Laravel Packagev13.xMIT License1.1K+ downloadsAI Ready · Laravel Boost

Translatable: One API, three ways to store translations

Laravel Translatable lets each Eloquent model choose where its translations live: a translations table, a JSON column per field, or a column per field and locale. You write $post->title, setTranslation() and whereTranslation() the same way for all three, and move a model from one storage to another later without losing a translation. It is AI ready: php artisan boost:install teaches your coding agent the whole package through Laravel Boost.

$composer require pharaonic/laravel-translatable

Compatibility

Each line is released for the versions in its row, read from that release's composer.json. Pick the line that matches your project; a combination not listed isn't supported. Find the right line of every package for your project.

LineLatest releasePHPLaravelStatusDocs
v13.xv13.0.3 Nov 20, 20268.3 – 8.513Current Docs: Read the v13.x docs
v12.xv12.0.2 Nov 20, 20268.2 – 8.512Maintained Docs: Read the v12.x docs
v11.xv11.0.2 Nov 20, 20268.2 – 8.411MaintainedLaravel 11 no longer gets security fixes Docs: Read the v11.x docs
v10.xv10.0.2 Nov 20, 20268.1 – 8.310MaintainedLaravel 10 no longer gets security fixes Docs: Read the v10.x docs
v9.xv9.0.1 Nov 19, 20268.0 – 8.29MaintainedLaravel 9 no longer gets security fixes Docs: Read the v9.x docs
v8.xv8.0.1 Nov 19, 20268.0 – 8.18MaintainedLaravel 8 no longer gets security fixes Docs: Read the v8.x docs
v7.xv7.0.1 Nov 19, 20268.07MaintainedLaravel 7 no longer gets security fixes Docs: Read the v7.x docs
v6.xv6.0.1 Nov 19, 20268.06MaintainedLaravel 6 no longer gets security fixes Docs: Read the v6.x docs

Maintenance

Latest release
v13.0.3
Nov 20, 2026 (5 days ago)
Released lines
8
documented lines with a release; see compatibility
CI on develop
Tests passed
latest run Nov 20, 2026

From the package's releases and its GitHub Actions. A passing run means the test suite passed on develop, on every PHP version it supports; it isn't a security review, and each release line has its own runs on GitHub. Checked hourly.

A quick look

Choose a strategy with one marker interface; the code that uses the model never changes.

app/Post.php
1class Post extends Model { use Translatable; } // translations table
2class Tag extends Model implements JsonTranslatable { use Translatable; } // a JSON column per field
3class Country extends Model implements ColumnsTranslatable { use Translatable; } // name_en, name_ar columns
4 
5// The same code under all three:
6$post->setTranslation('title', 'ar', 'مرحبا')->save();
7$tag->name; // the current locale, with fallback
8Country::whereTranslation('name', 'مصر', 'ar')->first();
Three Strategies, One API

Pick the storage that fits each model

Every strategy has the same reads, writes, scopes and events, so changing your mind costs a command, not a rewrite.

Translations Table

One row per model and locale in post_translations, with a real HasMany relation. The default, and the 2.x storage.

JSON Column per Field

title holds {"en": "Hello", "ar": "مرحبا"} on the model's own row. No extra table, any number of locales.

Column per Locale

title_en and title_ar columns, read from your table. Plain columns, plain indexes, a fixed set of locales.

The Same API Everywhere

$post->title, whereTranslation() and orderByTranslation() return the same results under all three, on SQLite, MySQL, MariaDB and PostgreSQL.

Move Between Them

translatable:migrate copies a model's translations to another strategy, translatable:verify checks them, translatable:rollback undoes it.

AI Ready

Ships a Laravel Boost guideline and a translatable-development skill, so php artisan boost:install teaches Claude Code, Cursor, Codex or Copilot the whole API.

Related Guides

Practical guides that use Laravel Translatable, or solve the problem it was built for.

FAQ

Translatable Questions

Quick answers about installing and using Translatable.

What is Translatable?

Translated Eloquent fields with three storage strategies behind one API, a translations table, a JSON column per field, or a column per field and locale, chosen per model, with fallbacks, typed fields, scopes and commands to move data between them. It's a free, open-source Laravel package by Pharaonic.

How do I install Translatable?

Run composer require pharaonic/laravel-translatable in your project's root directory.

What does Translatable require?

The latest release requires PHP 8.3 – 8.5 and Laravel 13.

Which storage strategies does Translatable support?

Three: a translations table (one row per model and locale, the default), a JSON column per field, and a column per field and locale (title_en, title_ar). Each model chooses one with a marker interface, or follows config('translatable.strategy').

Which storage strategy should I use?

The translations table suits many locales and long text. JSON keeps everything on the model's row with any number of locales. Columns suit a small fixed set of locales that you filter or sort with plain indexes. Every strategy has the same API, so you can change your mind later.

Can I move a model to another strategy later?

Yes. translatable:make-schema writes the new storage's migration, translatable:migrate --apply copies the translations, and translatable:verify compares them. The source is never changed, and translatable:rollback undoes a copy.

I use version 2.x. Do I need to migrate my database?

No. The table strategy keeps the 2.x storage. Rename $translatableAttributes to $translatables, check the upgrade guide for behavior changes, and run your tests.

Is Translatable AI ready?

Yes. It ships a Laravel Boost guideline and a translatable-development skill. Run php artisan boost:install in an application that uses Laravel Boost, and your coding agent (Claude Code, Cursor, Codex, Copilot…) learns the package's strategies, API and commands.

Does it work with Laravel Octane?

Yes. Pending changes live on each model, and the locale and configuration are read on every call. Reload the workers after adding a locale column.

Is Translatable free to use?

Yes. Translatable is open source under the MIT license, so you can use it in personal and commercial projects.

Where can I find the Translatable documentation?

Read the Translatable documentation for setup, configuration, and usage examples.

How do I report a bug or contribute to Translatable?

Open an issue or a pull request on GitHub, ask in GitHub Discussions, or chat with us on Discord.

Ready to dig in?

Read the full documentation for installation, the three strategies, field definitions, querying, saving and events, the generators, moving between strategies, Octane, Laravel Boost, and upgrading from 2.x.