mirror of
https://gitee.com/ctexthuang/hyperf_rbac_framework_server_ctexthuang.git
synced 2025-12-25 15:57:50 +08:00
fix : first finish
This commit is contained in:
@@ -36,13 +36,13 @@ class AdminRoleRequest extends FormRequest
|
||||
'sort' => 'required|integer',
|
||||
'remark' => 'nullable|string|max:255',
|
||||
'permissions' => 'sometimes|array',
|
||||
'permissions.*' => 'string|exists:menu,name',
|
||||
'permissions.*' => 'string|exists:admin_menu,name',
|
||||
];
|
||||
if ($this->isCreate()) {
|
||||
$rules['code'][] = 'unique:role,code';
|
||||
$rules['code'][] = 'unique:admin_role,code';
|
||||
}
|
||||
if ($this->isUpdate()) {
|
||||
$rules['code'][] = 'unique:role,code,' . $this->route('id');
|
||||
$rules['code'][] = 'unique:admin_role,code,' . $this->route('id');
|
||||
}
|
||||
|
||||
return $rules;
|
||||
|
||||
Reference in New Issue
Block a user