Code Duplication    Length = 21-21 lines in 3 locations

src/Controllers/PermissionsController.php 1 location

@@ 96-116 (lines=21) @@
93
     *
94
     * @return $this|\Illuminate\Http\RedirectResponse
95
     */
96
    public function update(Request $request, $id)
97
    {
98
        try {
99
            $this->permissionRepositoryInterface->update($request->all(), $id);
100
        } catch (FormValidationException $e) {
101
            Flash::error($e->getMessage());
102
103
            return redirect()
104
              ->route('permissions.edit', ['id' => $id])
105
              ->withErrors($e->getErrors())
106
              ->withInput();
107
        } catch (PermissionsException $e) {
108
            Flash::error($e->getMessage());
109
110
            return redirect()->route('permissions.index');
111
        }
112
113
        Flash::success(trans('dashboard::dashboard.flash.permission.edit.success'));
114
115
        return redirect()->route('permissions.edit', ['id' => $id]);
116
    }
117
118
    /**
119
     * Remove the specified resource from storage.

src/Controllers/RolesController.php 1 location

@@ 98-118 (lines=21) @@
95
     *
96
     * @return Response
97
     */
98
    public function update(Request $request, $id)
99
    {
100
        try {
101
            $this->roleRepositoryInterface->update($request->all(), $id);
102
        } catch (FormValidationException $e) {
103
            Flash::error($e->getMessage());
104
105
            return redirect()
106
              ->route('roles.edit', ['id' => $id])
107
              ->withErrors($e->getErrors())
108
              ->withInput();
109
        } catch (RolesException $e) {
110
            Flash::error($e->getMessage());
111
112
            return redirect()->route('roles.index');
113
        }
114
115
        Flash::success(trans('dashboard::dashboard.flash.role.edit.success'));
116
117
        return redirect()->route('roles.edit', ['id' => $id]);
118
    }
119
120
    /**
121
     * Remove the specified resource from storage.

src/Controllers/UsersController.php 1 location

@@ 114-134 (lines=21) @@
111
     *
112
     * @return $this|\Illuminate\Http\RedirectResponse
113
     */
114
    public function update(Request $request, $id)
115
    {
116
        try {
117
            $this->userRepositoryInterface->update($request->all(), $id);
118
        } catch (FormValidationException $e) {
119
            Flash::error($e->getMessage());
120
121
            return redirect()
122
              ->route('users.edit', ['id' => $id])
123
              ->withErrors($e->getErrors())
124
              ->withInput();
125
        } catch (UsersException $e) {
126
            Flash::error($e->getMessage());
127
128
            return redirect()->route('users.index');
129
        }
130
131
        Flash::success(trans('dashboard::dashboard.flash.user.edit.success'));
132
133
        return redirect()->route('users.edit', ['id' => $id]);
134
    }
135
136
    /**
137
     * Remove the specified resource from storage.