Skip to content

Commit

Permalink
fix: correctly determine if it's a string rule
Browse files Browse the repository at this point in the history
  • Loading branch information
winternet-studio committed Feb 15, 2024
1 parent d800be0 commit 53e4251
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ModelHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public static function getAttributeLength($model, $attribute) {
$rules = static::getAttributeRules($model, $attribute);
$length = [];
foreach ($rules as $rule) {
if ($rule[0] === 'string') {
if ($rule[1] === 'string') {
if (is_numeric(@$rule['max'])) {
$length['max'] = $rule['max'];
}
Expand Down

0 comments on commit 53e4251

Please sign in to comment.