for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Milwad\LaravelValidate\Rules;
use Illuminate\Contracts\Validation\Rule;
class ValidCapitalCharWithNumber implements Rule
{
/**
* Check all words are capital & with hyphen & number.
*/
public function passes($attribute, $value): bool
return preg_match('/[A-Z]{2,}-\d+/', $value);
return preg_match('/[A-Z]{2,}-\d+/', $value)
integer
boolean
}
* Get the validation error message.
public function message(): string
return __('validate.capital-char-with-number');