Skip to content

Commit cbd49f0

Browse files
committed
fix: improve validation rules detection
1 parent 66a5cd9 commit cbd49f0

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Fields/Field.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -842,10 +842,6 @@ protected function guessTypeFromValidationRules(): ?string
842842
return 'boolean';
843843
}
844844

845-
if ($this->hasAnyRule($ruleStrings, ['integer', 'int', 'numeric', 'min:', 'max:', 'between:'])) {
846-
return 'number';
847-
}
848-
849845
if ($this->hasAnyRule($ruleStrings, ['email', 'url', 'ip', 'uuid', 'string', 'regex', 'in', 'array'])) {
850846
return 'string';
851847
}
@@ -858,6 +854,9 @@ protected function guessTypeFromValidationRules(): ?string
858854
return 'string'; // Files are typically handled as strings (paths/URLs)
859855
}
860856

857+
if ($this->hasAnyRule($ruleStrings, ['integer', 'int', 'numeric', 'between:'])) {
858+
return 'number';
859+
}
861860
return null;
862861
}
863862

0 commit comments

Comments
 (0)