Support the ongoing development of Laravel.io →
Database Eloquent Architecture
Last updated 2 years ago.
0

Ok, I have solved this for my projects and have created a package for anyone that comes into this situation again: TranslateThatModel

Last updated 2 years ago.
0

Here is another approach on translating Eloquent objects: https://github.com/vinkla/translator

Last updated 2 years ago.
0

Hello,

I 've created a package igaster/laravel-translate-eloquent that adds translation to any Eloquent Model. It requires only one additional table in your DB where all the translations will be stored...

  • You can get/set a translated key as it was a normal Eloquent key (eg $article->title), when actually the correct translation will be looked up and returned from the Translations table...
  • Of course you can request a translation to any locale.
  • It supports a fallback locale if there is no translation in the current locale.

Hope it is usefull... Cheers!

0

Sign in to participate in this thread!

Eventy

Your banner here too?

mabasic mabasic Joined 3 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.