I would like to send below section’s data as an array to Laravel backend. Is there method to accomplish that without stringifying?
// preferred output
$members = [
["name" => "Sam", "location" => "US" ],
["name" => "Mike", "location" => "UK" ]
];
2
Answers
Assuming you have a form with select and location on each row.
Here is the example snippet:-
You can adjust the html for errors and other stuff with or without blade syntax as you wish.
Structure your html form like below,
and so on…
index in
members[index][name]
would be dynamic and increased by 1And in your
controller
function you will getmembers
array like,