Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation rules on localised settings do not seem to work #82

Open
harmenjanssen opened this issue Oct 28, 2021 · 1 comment
Open

Validation rules on localised settings do not seem to work #82

harmenjanssen opened this issue Oct 28, 2021 · 1 comment

Comments

@harmenjanssen
Copy link

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?

@Tarpsvo
Copy link
Collaborator

Tarpsvo commented Oct 29, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants