@@ -377,6 +377,8 @@ public function digitsBetween(int $min, int $max): self
377377 * pass a callback which accepts a {@see \Illuminate\Validation\Rules\Dimensions} instance.
378378 *
379379 * @link https://laravel.com/docs/10.x/validation#rule-dimensions
380+ * @param array<string, int|float> $constraints
381+ * @param ?callable(\Illuminate\Validation\Rules\Dimensions): void $modifier
380382 */
381383 public function dimensions (array $ constraints , ?callable $ modifier = null ): self
382384 {
@@ -444,10 +446,17 @@ public function endsWith(string ...$value): self
444446 *
445447 * @link https://laravel.com/docs/10.x/validation#rule-enum
446448 * @param class-string $type
449+ * @param ?callable(\Illuminate\Validation\Rules\Enum): void $modifier
447450 */
448- public function enum (string $ type ): self
451+ public function enum (string $ type, ? callable $ modifier = null ): self
449452 {
450- return $ this ->rule (Rule::enum ($ type ));
453+ $ rule = Rule::enum ($ type );
454+
455+ if ($ modifier ) {
456+ $ modifier ($ rule );
457+ }
458+
459+ return $ this ->rule ($ rule );
451460 }
452461
453462 /**
@@ -526,6 +535,7 @@ public function excludeWithout(string $anotherField): self
526535 * {@see RuleSet::rule} or pass a callback which accepts an {@see \Illuminate\Validation\Rules\Exists} instance.
527536 *
528537 * @link https://laravel.com/docs/10.x/validation#rule-exists
538+ * @param ?callable(\Illuminate\Validation\Rules\Exists): void $modifier
529539 */
530540 public function exists (string $ table , string $ column = 'NULL ' , ?callable $ modifier = null ): self
531541 {
@@ -899,6 +909,7 @@ public function numeric(): self
899909 * use {@see Rule::password} with {@see RuleSet::rule}, or pass a callback which accepts a {@see Password} instance.
900910 *
901911 * @link https://laravel.com/docs/10.x/validation#validating-passwords
912+ * @param ?callable(\Illuminate\Validation\Rules\Password): void $modifier
902913 */
903914 public function password (?int $ size = null , ?callable $ modifier = null ): self
904915 {
@@ -972,7 +983,7 @@ public function prohibited(): self
972983 * passed in closure returns true.
973984 *
974985 * @link https://laravel.com/docs/10.x/validation#rule-prohibited-if
975- * @param callable| bool $callback
986+ * @param bool|callable(): bool $callback
976987 */
977988 public function prohibitedIf (mixed $ callback ): self
978989 {
@@ -1044,7 +1055,7 @@ public function requiredArrayKeys(string ...$key): self
10441055 * closure returns true.
10451056 *
10461057 * @link https://laravel.com/docs/10.x/validation#rule-required-if
1047- * @param callable| bool $callback
1058+ * @param bool|callable(): bool $callback
10481059 */
10491060 public function requiredIf (mixed $ callback ): self
10501061 {
@@ -1226,6 +1237,7 @@ public function ulid(): self
12261237 * {@see RuleSet::rule} or pass a callback which accepts a {@see \Illuminate\Validation\Rules\Unique} instance.
12271238 *
12281239 * @link https://laravel.com/docs/10.x/validation#rule-unique
1240+ * @param ?callable(\Illuminate\Validation\Rules\Unique): void $modifier
12291241 */
12301242 public function unique (string $ table , string $ column = 'NULL ' , ?callable $ modifier = null ): self
12311243 {
0 commit comments