1
I need to do a validation of a zip code field, but the following attempts do not work:
$rules= ['cep' => 'required|numeric|size:8'];
ou
$rules= ['cep' => 'required|numeric|min:8'];
ou
$rules= ['cep' => 'numeric|size:8'];
The following validations function:
$rules= ['cep' => 'required|numeric'];
ou
$rules= ['cep' => 'required|size:8'];
Does anyone have any idea why it doesn’t work?
Thanks for the reply, @Virgilio-novic ! But, regardless of the ZIP code validation case, if I do the same validation of a field that, for example, should be filled, numerical and have 3 digits, the $Rules= ['campox' => 'required|Numeric|size:3'] rule still doesn’t work.
– Julio Alves
@Julioalves I did the editing and now do the test with
digits:8
, because in these digits it needs to be a number with an exact amount of numbers, including the 0 to the left.– novic
Now yes, @Virgilionovic! Solved the problem. Thank you very much!
– Julio Alves
@Julioalves nice that was solved.
– novic