how to use custom rule for validation laravel 8 code example
Example 1: laravel custom validation rules
php artisan make:rule Uppercase
Example 2: custom rule laravel validation
public function store()
{
$this->validate(request(), [
'song' => [function ($attribute, $value, $fail) {
if ($value <= 10) {
$fail(':attribute needs more cowbell!');
}
}]
]);
}