Closed sharenjoy closed 4 years ago
Let's assume you are using this package https://github.com/optimistdigital/nova-translatable to translate settings with spatie/laravel-translatable.
Text::make('Some Setting', 'setting_key')->translatable(),
json_decode(nova_get_setting('setting_key'), true)[app()->getLocale()]
You can make your own helper for these cases.
function nova_get_translatable_setting($key, $lang = 'en') {
return nova_get_setting($key)[$lang] ?? null;
}
@Tarpsvo where do I make this helper please ?, I'am also using https://github.com/optimistdigital/nova-translatable
I think that this package support spatie/laravel-translatable. How I get translatable value via helper function?