jeudi 7 mars 2019

Laravel validating distinct values in array but ignoring keys

I'm trying to validate a simple array with automatic numeric keys e.g.

[0] => 5,
[1] => 9,
[2] => 9

Using the following validation rule:

'content_types.*' => 'numeric|distinct',

But it's not catching the duplicate values and throwing an error. Is the distinct rule ignoring the rule as it's not distinct as the key is different and if so how would I validate this? It seems so simple so am I missing something? Thanks



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire