lundi 18 mars 2019

Laravel 5 form validation of array on different

from request I get an array like this:

'array' => [
    0 => ['id' => 1,'val' => 2],
    1 => ['id' => 1,'val' => 2]
]

I need to validate it so all ids of array will be unique. right now I try this validation rule:

'array.*.id' => 'different:array.*.id'

but it will check current array with current array so result will be like

The array.0.id and array.0.id must be different.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire