【发布时间】:2016-01-08 22:57:33
【问题描述】:
我有这个 var_dump 结果
'children' =>
array (size=2)
0 => string 'children on row 1' (length=17)
1 => string 'children on row 2' (length=17)
'type_of_delivery' =>
array (size=2)
0 => string 'type of delivery on row 1' (length=25)
1 => string 'type of delivery on row 2' (length=25)
'date' =>
array (size=2)
0 => string 'Oct 11, 2015' (length=12)
1 => string 'Oct 11, 2015' (length=12)
来自我的输入
<table>
<thead>
<tr>
<th>Children</th>
<th>Type of Delivery</th>
<th>Date</th>
<tr>
<thead>
<tbody>
<tr>
<td><input type="text" name="children[]" /></td>
<td><input type="text" name="type_of_delivery[]" /></td>
<td><input type="text" name="date[]" /></td>
</tr>
<tr>
<td><input type="text" name="children[]" /></td>
<td><input type="text" name="type_of_delivery[]" /></td>
<td><input type="text" name="date[]" /></td>
</tr>
</tbody>
</table>
对于这些请求数据,我有一个列“children”、“type_of_delivery”、“date”。我想像每组一样保存它,例如数组 0 的孩子 + 数组 0 的 type_of_delivery + 数组 0 日期等等。
假设我已经成功保存了这些数据,它应该看起来像这样。
--------------------------------------------------------------
children | type of delivery | date
--------------------------------------------------------------
children on row 1 | type of delivery on row 1 | Oct 11, 2015
children on row 2 | type of delivery on row 2 | Oct 11, 2015
任何想法,线索,请帮助如何制作?
【问题讨论】:
-
到目前为止你尝试了什么?
标签: mysql database laravel laravel-5 eloquent