Commit 88061157 authored by 梁俊杰's avatar 梁俊杰

自动生成,验证器更新规则调整操作

parent 634079b3
......@@ -565,8 +565,8 @@ class MakeModelCommand extends HyperfCommand
$messages = join(",\n", $messages);
$patterns = ["%ModelClass%", '%createRules%', '%updateRules%', '%attributes%', '%messages%'];
$createRules = $rules;
$updateRules = str_replace("nullable", "sometimes", $rules);
$updateRules = str_replace("required", "sometimes", $updateRules);
$updateRules = str_replace("nullable", "sometimes|nullable", $rules);
$updateRules = str_replace("required", "sometimes|required", $updateRules);
$replacements = [$modelClass, $createRules, $updateRules, $attributes, $messages];
$content = $this->buildField($patterns, $replacements, $content);
$this->writeToFile($file, $content);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment