Code Duplication    Length = 10-11 lines in 2 locations

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

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

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

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