Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

gdavid's avatar

nova validation required_if two values of other inputs are

Hi, i"m struggling doing this in nova:

there is a form for repair product.

you must enter "repair cost" only if warranty = "noWarranty" and repair = "completed"

warranty and repair are cells on the same form and you can't get them from the database yet

(You do not know the repair cost before the lab fully fixed it).

i can use ->rules('required_if:warranty,noWarranty')

however if i use "required_if" twice ->rules('required_if:warranty,noWarranty','required_if:repair,completed')

it will be required if

warranty = "noWarranty" or repair = "completed"

and i need it to be required if

warranty = "noWarranty" and repair = "completed"

0 likes
2 replies
gdavid's avatar

ok, than how do i access the value of other cells of the same form inside the Custom validation

Please or to participate in this conversation.