validation in array after array
rows[
0 {
title: "my title",
post: "my post text"
},
1 {
title: "my title",
post: "my post text"
},
2 {
title: "my title",
post: "my post text"
}
]
$validator = Validator::make($request->all(), [
'row.*.title' => 'required',
'row.*.post' => 'required',
]);
Asterisk symbol (*) is used to check values in the array, not the array itself.
$validator = Validator::make($request->all(), [
"names" => "required|array|min:3",
"names.*" => "required|string|distinct|min:3",
]);