ziffmedia / nova-select-plus

A Laravel Nova Select Field
MIT License
91 stars 26 forks source link

Required fields not supported #68

Open beliven-fabrizio-gortani opened 6 months ago

beliven-fabrizio-gortani commented 6 months ago

I am trying to integrate the select plus component into my project; however, it seems that the validation rules I have set using the rules method are not being correctly interpreted, or rather it seems that they are being completely ignored. I am attaching an example of the code:

SelectPlus::make("My roles", 'roles', Role::class)
                ->rules('required','min:1'),

when instead I select at least one option, it works successfully.

What I'm doing wrong?

grantholle commented 4 months ago

I've submitted a PR for adding this to the docs.

Here's how I solved it: https://github.com/grantholle/nova-select-plus/tree/validation-instructions?tab=readme-ov-file#validation