Can't use Laravel Validation rules exclude_unless (or even with exclude_if).
I need my field allergens to be required only if my field is_active is true.
Following code doesn't seem to work. No error code, but the validation doesn't work.
Detailed steps to reproduce the issue on a fresh Nova installation:
Boolean::make('Actif', 'is_active'),
Textarea::make('Allergènes', 'allergens')
->rules('exclude_if:is_active,true|required'),
// I also tried this
Textarea::make('Allergènes', 'allergens')
->rules('exclude_if:is_active,true', 'required'),
Greetings from Belgium !
Description:
Can't use Laravel Validation rules
exclude_unless
(or even withexclude_if
). I need my fieldallergens
to be required only if my fieldis_active
istrue
.Following code doesn't seem to work. No error code, but the validation doesn't work.
Detailed steps to reproduce the issue on a fresh Nova installation:
Thanks for the ideas or correct usage, Romain