Code Duplication    Length = 10-11 lines in 2 locations

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
    {

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

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