spatie / laravel-translatable

Making Eloquent models translatable

Home Page:https://spatie.be/docs/laravel-translatable

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can not return translation in nested json

NaeemSohrabi opened this issue · comments

Hi
i have a nested json like this in column home:
{
"tags": {
"en": [
"one",
"tow"
],
"fa": [
"اول"
]
},
"description": {
"en": "

lorem ipsum

",
"fa": "

لورم ایپسوم

"
}
}
that the languages are in second level
and in my model , translatable is like this:
public $translatable = ['home.*'];
but it returns both fa and en languages.
in other columns that is like this:
{
"en": "lorem",
"fa": "الورم"
}
and in my model , translatable is like this:
public $translatable = ['title'];
translate works fine. , but in that case does not.
How should i use translate for that nested json????
please help
Thanks