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

Specify which translations to return from getTranslations()

zjbarg opened this issue · comments

Is there a way to specify which translations to return from getTranslations()?

\\ This will return all the translations
$model->getTranslations('field'); // ['en-GB' => 'Hello', 'ar-JO' => 'مرحبا', 'ru-RU'  => 'Привет' ]

\\ I would like to do something like: 
$model->getTranslations('field', ['en-GB', 'ar-JO']); // ['en-GB' => 'Hello', 'ar-JO' => 'مرحبا']

How do you guys feel about this?

I'm going to leave things as they are. Thanks for the suggestion though.