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

Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future. Achieve superior email deliverability with ToastMail! Our AI-driven tool warms up inboxes, monitors reputation, and ensures emails reach their intended destination. Sign up today for a spam-free future.
Community Partners