nova-settings
nova-settings copied to clipboard
Validation rules on localised settings do not seem to work
I'm trying to make settings required only in certain languages.
Following the documentation of nova-translatable
, I've implemented this as follows:
Text::make('Street address', 'address_street')
->translatable()
->nullable()
->rulesFor('en', ['required']),
However, this does not make the (English) field required.
I noticed in the docs that usually you have to add the HandlesTranslatable
trait to the resource, but since I'm registering these fields in the NovaServiceProvider, that doesn't seem appropriate.
Can you tell me how to fix this?
Hmmmm, that's a very good point - I don't think I ever tested for that usecase. It currently isn't supported, but I will try to think of a solution.