Skip to content

Laravel Eloquent TranslatableHigh performance translations for Laravel models

Laravel Eloquent Translatable Logo

Why another Laravel translation package?

While packages like spatie/laravel-translatable and astrotomic/laravel-translatable are powerful, they all make a trade-off. This package is built for raw performance and a clean, focused developer experience by using direct, indexed database queries instead of relying on JSON columns or Eloquent model hydration.

aaix/eloquent-translatablespatie/laravel-translatableastrotomic/laravel-translatable
StorageDedicated TableJSON ColumnDedicated Table
PerformanceHigh (Scalable)Fastest (Single Record Reads)High (Eloquent)
SimplicityMinimal API, Zero-Config LogicRequires managing JSON paths & complex queriesRequires extra Translation Model class
text
======================================================================================================
                                    🚀 Performance Comparison 🚀
======================================================================================================
| Test Case                       | aaix         | astrotomic              | spatie                  |
|---------------------------------|--------------|-------------------------|-------------------------|
| Read: Access 1st Translation    | 1.70 ms      | 1.65 ms (-3.1%)         | 0.55 ms (-68.0%)        |
| Read: Find by Translation       | 1.01 ms      | 1.20 ms (+18.6%)        | 0.89 ms (-12.6%)        |
| Read: Eager Load 50 Products    | 1.97 ms      | 2.82 ms (+43.3%)        | 1.16 ms (-40.9%)        |
| Write: Create + 1 Translation   | 1.27 ms      | 1.73 ms (+36.0%)        | 1.04 ms (-17.7%)        |
| Write: Create + All Transl.     | 1.45 ms      | 3.80 ms (+162.8%)       | 1.03 ms (-28.6%)        |
| Write: Update 1 Translation     | 0.77 ms      | 0.82 ms (+7.0%)         | 0.41 ms (-46.2%)        |
======================================================================================================

SUPERIOR Database Performance

By using direct, indexed database queries instead of parsing JSON or hydrating countless Eloquent models, operations are significantly faster and use a fraction of the memory. This is not a minor improvement; it's a fundamental architectural advantage for applications at scale.

BETTER Data Integrity

Translations are stored in a clean, normalized, and dedicated table. This provides better data integrity and structure than a single JSON column and avoids the performance pitfalls of a full Eloquent-relation approach.

SIMPLER Developer Experience

The API is designed to be minimal, intuitive, and predictable. With a single command to set up your migrations and a fluent, easy-to-understand set of methods, you get the power you need without the complexity you don't. No magic, just performance.