modify plugin name

This commit is contained in:
2022-02-25 17:12:15 +08:00
parent 14dd7efda6
commit db725b710d
13 changed files with 60 additions and 60 deletions
+3 -3
View File
@@ -33,11 +33,11 @@ class EmptyValidator extends BaseValidator
return $this->_validator($this->field, function ($field, $params, $method) {
$value = $params[$field] ?? null;
if (empty($value)) {
return $this->addError(':attribute not exists');
return $this->addError($field,':attribute not exists');
}
return match ($method) {
self::CAN_NOT_EMPTY => isset($value[1]) || $this->addError('The :attribute can not empty.'),
default => $value !== null || $this->addError('The :attribute can not empty.')
self::CAN_NOT_EMPTY => isset($value[1]) || $this->addError($field,'The :attribute can not empty.'),
default => $value !== null || $this->addError($field,'The :attribute can not empty.')
};
}, $this->params, strtolower($this->method));
}