min = $min; } /** * Run the validation rule. */ public function validate(string $attribute, mixed $value, Closure $fail): void { if (! is_string($value)) { $fail("The {$attribute} must be a string."); return; } $count = grapheme_strlen($value); if ($count < $this->min) { $fail("The {$attribute} must be at least {$this->min} graphemes."); } } }