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

madala's avatar

Need Suggestion

Hi All,

I'm a junior developer need some suggestion. I had a form which has a section to enter patient details with fields as first name ,last name etc. in same form we have section called authorized representative with fields first name, last name, and some checkbox fields option at the same time I had a "button" to add additional (to add more than one additional authorized representative)authorized representatives . Do I need to add the name attribute as an array or for each additional representative I need to have a different name attribute? and at the same time how to handle this when I'm updating the patient form with more than one Representative and here, I can add one more new representative in the update form. can anyone give some idea? Please.

0 likes
2 replies
Snapey's avatar

you can name fields like patient[1]firstname if you can arrange for an incrementing counter for each patient added

you will then get an array passed to Laravel and can validate with 'patient.*.firstname' etc

Please or to participate in this conversation.