Code Duplication    Length = 11-11 lines in 2 locations

src/Controllers/ModelForm.php 1 location

@@ 40-50 (lines=11) @@
37
     */
38
    public function destroy($id)
39
    {
40
        if ($this->form()->destroy($id)) {
41
            return response()->json([
42
                'status'  => true,
43
                'message' => trans('admin.delete_succeeded'),
44
            ]);
45
        } else {
46
            return response()->json([
47
                'status'  => false,
48
                'message' => trans('admin.delete_failed'),
49
            ]);
50
        }
51
    }
52
53
    /**

src/Controllers/UserController.php 1 location

@@ 159-169 (lines=11) @@
156
            ]);
157
        }
158
159
        if ($this->form()->destroy($id)) {
160
            return response()->json([
161
                'status'  => true,
162
                'message' => trans('admin.delete_succeeded'),
163
            ]);
164
        } else {
165
            return response()->json([
166
                'status'  => false,
167
                'message' => trans('admin.delete_failed'),
168
            ]);
169
        }
170
    }
171
}
172