Code Duplication    Length = 10-11 lines in 2 locations

src/Http/Controllers/GroupEgovernmentController.php 2 locations

@@ 108-117 (lines=10) @@
105
        if($validator->fails()){
106
            $check = $group_egovernment->where('label',$request->label)->whereNull('deleted_at')->count();
107
108
            if ($check > 0) {
109
                $response['message'] = 'Failed, label ' . $request->label . ' already exists';
110
            } else {
111
                $group_egovernment->label         = $request->input('label');
112
                $group_egovernment->description   = $request->input('description');
113
                $group_egovernment->user_id       = $request->input('user_id');
114
                $group_egovernment->save();
115
116
                $response['message'] = 'success';
117
            }
118
        } else {
119
                $group_egovernment->label         = $request->input('label');
120
                $group_egovernment->description   = $request->input('description');
@@ 198-208 (lines=11) @@
195
196
                $check_label   = $this->group_egovernment->where('id','!=', $id)->where('label', $request->label);
197
198
                if($check_label->count() > 0){
199
                    $response['message'] = implode("\n",$message);
200
201
            } else {
202
                $group_egovernment->label                    = $request->input('label');
203
                $group_egovernment->description              = $request->input('description');
204
                $group_egovernment->user_id                  = $request->input('user_id');
205
                $group_egovernment->save();
206
207
                $response['message'] = 'success';
208
            }
209
210
        } else {
211
                $group_egovernment->label                    = $request->input('label');