Snippets - Laravel

Fluent Email Validation Rule in Laravel

|
Anuz Pandey

Laravel 11.38 has a new Email validation rule providing similar experience as Password and File validation rules.

The new Rule::email() object offers a smarter and more user-friendly way to handle email validation compared to the traditional array-based approach. It makes combining rules easier, keeps our code cleaner. With the new Email class, we can extend its functionality with macros. This becomes super handy when we have different email validation requirements in various part of our application. It’s all about making things simpler and more flexible, and huge thanks to Sander Muller for this awesome addition.

Keep coding, keep exploring and inspiring. 🐼


  • Tags:
  • laravel
  • email
  • validation