When you try to validate a field must be included in the given list of values. The first value of the array list never match. The validation always returns that the first value of the array list does not match.
If you add a new value at the begining of the array, the first one will never match.
'canton' => 'sometimes|required|size:2|in:' . Rule::in(['zh','zg','vs','vd','ur','ti']),
if you change the first value like this :
['fr','zh','zg','vs','vd','ur','ti']
the 'zh' working, but not the first 'fr'
If you use the Rule class to define the rule, don't use in: prefix.
@bonzai Correct, I do not know how I could miss it ...
Most helpful comment
If you use the
Ruleclass to define the rule, don't usein:prefix.https://laravel.com/docs/5.4/validation#rule-in