更新 app/Admin/Services/KeywordService.php
parent
51f69e9cc5
commit
6710bc0a4a
|
|
@ -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 已经存在'
|
||||
|
|
|
|||
Loading…
Reference in New Issue