_validator($this->field, function ($field, $params, $method) { $value = $params[$field] ?? null; if (empty($value)) { return $this->addError(':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.') }; }, $this->params, strtolower($this->method)); } }