Support the ongoing development of Laravel.io →
Requests Forms Validation
Last updated 2 years ago.
0
Solution

I don't think there's a way to repopulate both forms while keeping identical names.

You could probably change names to:

form1 -> contact[name], contact[email], contact[body]

form2 -> reservation[email], ...

And then change your controller, and validator if any, to use $request->input('contact') instead of $request->all() in ContactController, and $request->input('reservation') in ReservationController.

Last updated 9 years ago.
0

Thanks that worked great. For the sake of completeness (and for anyone else using this), don't forget to update your rules to names like 'contact.name', 'contact.email' and so on.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

timbertens timbertens Joined 21 Apr 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.