diff --git a/LengthValidator.php b/LengthValidator.php index 98d17d3..d7332b5 100644 --- a/LengthValidator.php +++ b/LengthValidator.php @@ -25,8 +25,8 @@ class LengthValidator extends BaseValidator */ public function trigger(): bool { - return $this->_validator($this->field, function ($field, $params, $method, $value) { - $value = $params[$this->field] ?? null; + return $this->_validator($this->field, function ($field, $params, $method, $length) { + $value = $params[$field] ?? null; if (empty($value)) { if ($method != self::MAX_LENGTH) { return $this->addError($field, 'The param :attribute not exists');