Код: Выделить всё
$data = [
[1, 2, 3],
[3, 4, 5]
];
$validator = \Validator::make([
"bla" => $data,
], [
'bla' => 'required|array',
'bla.*' => 'required|array|max:5|min:1',
'bla.*.*' => 'required|integer|distinct',
]);
if ($validator->fails()) {...}
Код: Выделить всё
The bla.0.2 field has a duplicate value.
The bla.1.0 field has a duplicate value.
Код: Выделить всё
distinct
Пример:
Это должно пройти:
Код: Выделить всё
$data = [
[1, 2, 3],
[3, 4, 5]
];
Код: Выделить всё
$data = [
[4, 4, 3],
[3, 8, 5]
];
Подробнее здесь: https://stackoverflow.com/questions/790 ... ay-element