From e2bdf812676ca00383f7119b51dac08f4dcf0506 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Tue, 1 Mar 2022 16:38:22 +0800 Subject: [PATCH] modify plugin name --- EnumValidator.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/EnumValidator.php b/EnumValidator.php index 77d16a1..9e9c2dd 100644 --- a/EnumValidator.php +++ b/EnumValidator.php @@ -21,7 +21,8 @@ class EnumValidator extends BaseValidator { return $this->_validator($this->field, function ($field, $params, $values) { if (!in_array($params[$field] ?? null, $values)) { - return $this->addError($field, 'The param :attribute value(' . $params[$field] . ') only in ' . implode(',', $values)); + $message = 'The param :attribute value(' . $params[$field] . ') only in ' . implode(',', $values); + return $this->addError($field, $message); } return true; }, $this->params, $this->value);