The biggest advantage of Laravel over other frameworks is the fact that it comes with a lot of built-in features. In this article, we are going to understand Laravel Custom Validation Rules. Laravel provides you with a rich set of validation rules which you can add to validate the requests. What is good about the framework is not only that it gives a bunch of built-in features but also allows you to extend its functionality and build your own set of rules, that you may get to use in more than one project.

When the rules() method will get executed, the BirthYearRule class will be instantiated and it will call the passes() method in the BirthYearRule class to validate the name.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners