1
0
Fork 0

更新 app/Admin/Services/KeywordService.php

panliang 2023-12-01 13:49:56 +08:00
parent 51f69e9cc5
commit 6710bc0a4a
1 changed files with 1 additions and 1 deletions

View File

@ -56,7 +56,7 @@ class KeywordService extends BaseService
'name' => ['required'],
];
$updateRules = [
'key' => [Rule::unique('keywords', 'key')->ignore($model->id)]
'key' => [Rule::unique('keywords', 'key')->ignore($model?->id)]
];
$validator = Validator::make($data, $model ? $updateRules : $createRules, [
'key.unique' => ':input 已经存在'