dimanche 18 août 2019

Laravel - Permanent validation for specific field

There are many places in my website where I request people specify their phone number or another types of data. Each place, the validation rules are the same, and chaining the same validation rules over and over again within every validator is not so pretty, and bad for future updates for the validation rules. Think about it, when I want to change the phone number validation rules for example, I need to change it on every form validator.

I know I can add custom validation rules using extensions and add some normal php conditions in order to achieve the desired validation, but it is not exactly what I want to do because I want to use several Laravel validations, and not to add a validation of my own.

Is there any way to do that? I went through all Laravel documentation and I didn't find any way of how can I do that.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2z9jUk0
via IFTTT

Aucun commentaire:

Enregistrer un commentaire