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

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