How to make spatie laravel settings package translatable by using spatie laravel translate package #268
Replies: 2 comments 1 reply
-
@khalilKhassep any solution for this? |
Beta Was this translation helpful? Give feedback.
-
I was able to make setting translatable using laravel-translatable from spatie with FilamentTranslatableTabs plugin (that i have found generally better then filament-translatable spatie plugin ). all you have to do with this setup is to wrap your form fields with TranslatableTabs and in the setting model class declare the HasTranslations trait of course and the array $translatable as protected so that it wont consider it as a setting to add to the table. for example The migration:
The Setting Model:
Finally the Filament Page:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been trying to integrate the settings package to work with the translation package and the only way I was able to achieve that is by casting payloads, is there any other way to integrate the translation package with the settings?
I'm using it with filamentphp
Beta Was this translation helpful? Give feedback.
All reactions