dynamically get added more if the user want,
<input type="text" name="name[]" value="name">
<input type="text" name="lastName[]" value="last_name">The output I currently get is this way
array:2 [▼
0 => array:2 [▼
0 => "sample1"
1 => "sample2"
]
1 => array:2 [▼
0 => "jh"
1 => "ch"
]
]how can i get the output like this in laravel when the data is submitted ?
array:2 [▼
0 => array:2 [▼
0 => "sample1"
0 => "jh"
]
1 => array:2 [▼
1 => "sample2"
1 => "ch"
]
]
Try something like this name=hahaha[someIncrementingIndexHere][name] name= hahaha[someIncrementingIndexHere][lastName]
Read laravel collections
Обсуждают сегодня