Sometimes the official Laravel validation rules are not enough, and you want to create something custom. It's pretty easy in Laravel, with php artisan make:rule command, and then you can use the generated class in the validation rules array.
Read more in the official Laravel docs.
Read more in the official Laravel docs.