modify plugin name
This commit is contained in:
+1
-5
@@ -20,11 +20,7 @@ class EnumValidator extends BaseValidator
|
|||||||
public function trigger(): bool
|
public function trigger(): bool
|
||||||
{
|
{
|
||||||
return $this->_validator($this->field, function ($field, $params, $values) {
|
return $this->_validator($this->field, function ($field, $params, $values) {
|
||||||
$value = $params[$field] ?? null;
|
if (!in_array($params[$field] ?? null, $values)) {
|
||||||
if (is_null($value) || $value === '') {
|
|
||||||
return $this->addError($field,'The param :attribute is null');
|
|
||||||
}
|
|
||||||
if (!in_array($value, $values)) {
|
|
||||||
return $this->addError($field,'The param :attribute value only in ' . implode(',', $values));
|
return $this->addError($field,'The param :attribute value only in ' . implode(',', $values));
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user