You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In docs for distinct validation rule it is written: "When working with arrays, the field under validation must not have any duplicate values.". But it checks not only the exactly the matching field, but all nested fields with the same attribute name. E.g. 'foo.*.id' => 'distinct' will check not only foo.0.id, foo.1.id,.. but also foo.0.nested.id.
The reason is that Str::is($attributeName, $key) matches not only foo.0.id or foo.1.id, but also foo.0.whatever.id
Description:
In docs for distinct validation rule it is written: "When working with arrays, the field under validation must not have any duplicate values.". But it checks not only the exactly the matching field, but all nested fields with the same attribute name. E.g.
'foo.*.id' => 'distinct'
will check not only foo.0.id, foo.1.id,.. but also foo.0.nested.id.The reason is that
Str::is($attributeName, $key)
matches not only foo.0.id or foo.1.id, but also foo.0.whatever.idSteps To Reproduce:
will fail and return "The foo.1.id field has a duplicate value."
The text was updated successfully, but these errors were encountered: