nova-settings icon indicating copy to clipboard operation
nova-settings copied to clipboard

Validation rules on localised settings do not seem to work

Open harmenjanssen opened this issue 3 years ago • 1 comments

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?

harmenjanssen avatar Oct 28 '21 07:10 harmenjanssen

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.

Tarpsvo avatar Oct 29 '21 15:10 Tarpsvo