minWords = $minWords; } public function passes(mixed $attribute, mixed $value): bool|int { $wordCount = count(preg_split('/\W+/u', $value, -1, PREG_SPLIT_NO_EMPTY)); return $wordCount >= $this->minWords; } public function message(): string { return "The :attribute must have at least {$this->minWords} words."; } }