Laravel Validation: Validating Input as Equal to a specific value or PHP Variable
TL; DR;
As of version 10, Laravel does not have a built-in way to validate that a field is equal to a specific value. However, you can easily create a custom rule to accomplish this.
Create scaffolding for the rule with artisan:
php artisan make:rule...
annissimo.com4 min read
Sean Kegel
Lead Software Engineer @ Curology
Good article, never realized there wasn’t an equals validation rule. I wonder if that’s something that should be in Laravel by default? Is it a use case you’ve run into often?