Code Duplication    Length = 10-11 lines in 2 locations

src/Http/Controllers/Manager/RoleController.php 1 location

@@ 63-73 (lines=11) @@
60
        return response()->json(['message' => 'ok']);
61
    }
62
63
    public function delete($id)
64
    {
65
        if ($id == 1) {
66
            throw new AdminHttpException('超级管理员角色不能删除');
67
        }
68
69
        $role = Role::findOrFail($id);
70
        $role->delete();
71
72
        return response()->json(['message' => 'ok']);
73
    }
74
75
    /**
76
     * 批量删除角色

src/Http/Controllers/Manager/UserController.php 1 location

@@ 39-48 (lines=10) @@
36
        return response()->json(['message' => 'ok']);
37
    }
38
39
    public function delete($id)
40
    {
41
        if ($id == 1) {
42
            throw new AdminHttpException('超级管理员不能删除');
43
        }
44
45
        $model = Manager::findOrFail($id);
46
        $model->delete();
47
        return response()->json(['message' => 'ok']);
48
    }
49
50
    public function saveRole(Request $request)
51
    {