Laravel do not validate if field is not required Laravel do not validate if field is not required laravel laravel

Laravel do not validate if field is not required


digits:10 is completely separate from required_if, so it will validate whether or not the field is required. However, if you want to also allow null or empty values (assuming the field is not required), you can add the rule nullable.

https://laravel.com/docs/5.5/validation#rule-nullable