hi, i want to use validation rule ' exclude_with:field'.
however my form always submits the field value, it could be null or integer. therefore it always excludes the field.
is there a way i could tweak this rule, or do i need to create custom validation rule?
i was trying something like 'exclude_if:field,!null'.
what would be the correct solution here?
#exclude_with to exclude present, but null values
1 messages · Page 1 of 1 (latest)
[
'role_id' => Rule::excludeIf($request->filled('field')),
]
https://laravel.com/docs/10.x/validation#rule-exclude-if
This might work