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

megaman7's avatar

dynamic form field validation

I have an app which has dynamic form fields (ones which may or may not be present depending on the value of another field).

I already use request objects to do basic validation on every field.

However it is possible to have a situation where a user changes a previously submitted form value, which causes some fields which are filled in to dissapear. But this on its own will not remove their values from the database.

Right now i have to read the value of the control fields and if their value means that the dynamic fields should not appear i change the values to null, this overwrites any existing values in the database.

Is there a way using request validation or any other laravel feature to do this?

0 likes
3 replies
megaman7's avatar

cool and is it possible to change the validation behavior to change the value to null - so that the database gets updated with null as the value

Please or to participate in this conversation.