$group(); if (! isset($groupRules[$key])) { throw new \Exception(sprintf("The %s configuration field under the %s group is not supported", $key, $group)); } $result = validator([$key => $value], [$key => $groupRules[$key]]); if ($result->fails()) { throw new \Exception($result->errors()->first()); } } /** * email 字段验证 * * @return string[] */ private function email(): array { return EmailConfigFieldEnum::checkRules(); } private function browser(): array { return BrowserConfigFiledEnum::checkRules(); } }