优化更新
This commit is contained in:
@@ -79,12 +79,11 @@ class Permission extends Controller
|
||||
public function store(Request $request)
|
||||
{
|
||||
$validated = $request->validate([
|
||||
'name' => 'required|string|max:50',
|
||||
'code' => 'required|string|max:100|unique:auth_permissions,code',
|
||||
'title' => 'required|string|max:50',
|
||||
'name' => 'required|string|max:100|unique:auth_permissions,name',
|
||||
'type' => 'required|in:menu,api,button',
|
||||
'route' => 'nullable|string|max:200',
|
||||
'component' => 'nullable|string|max:200',
|
||||
'icon' => 'nullable|string|max:50',
|
||||
'parent_id' => 'nullable|integer|exists:auth_permissions,id',
|
||||
'sort' => 'nullable|integer|min:0',
|
||||
'status' => 'nullable|integer|in:0,1',
|
||||
@@ -106,12 +105,11 @@ class Permission extends Controller
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$validated = $request->validate([
|
||||
'name' => 'nullable|string|max:50',
|
||||
'code' => 'nullable|string|max:100|unique:auth_permissions,code,' . $id,
|
||||
'title' => 'nullable|string|max:50',
|
||||
'name' => 'nullable|string|max:100|unique:auth_permissions,name,' . $id,
|
||||
'type' => 'nullable|in:menu,api,button',
|
||||
'route' => 'nullable|string|max:200',
|
||||
'component' => 'nullable|string|max:200',
|
||||
'icon' => 'nullable|string|max:50',
|
||||
'parent_id' => 'nullable|integer|exists:auth_permissions,id',
|
||||
'sort' => 'nullable|integer|min:0',
|
||||
'status' => 'nullable|integer|in:0,1',
|
||||
|
||||
Reference in New Issue
Block a user