<table>
<form action="/person/create" method="post">
{{ csrf_field() }}
<tr>
<th>name: </th>
<td><input type="text" name="person[name]" value="{{ old('name') }}"></td>
</tr>
<tr>
<th>email: </th>
<td><input type="text" name="person[email]" value="{{ old('email') }}"></td>
</tr>
<tr>
<th>age: </th>
<td><input type="text" name="person[age]" value="{{ old('age') }}"></td>
</tr>
<tr>
<th></th>
<td>
<input type="submit" value="send">
</td>
</tr>
</form>
</table>
上記のように配列にまとめてname="person[name]
のような形でフォームを送信する場合
バリデーションの書き方が少し変わる
・配列名.name
・配列名.email
上記のような指定方法となる
// バリデーション //
# requestが配列で送られてくる場合は'配列.要素名'となる
public static $rules = array(
'person.name' => 'required',
'person.email' => 'email',
'person.age' => 'integer|min:0|max:150'
);