Code Duplication    Length = 7-14 lines in 2 locations

src/Http/Controllers/TransitionController.php 1 location

@@ 145-158 (lines=14) @@
142
            'workflow_id'   => 'required',
143
        ]);
144
145
        if($validator->fails()){
146
            //if($check > 0){
147
                $response['message']    = 'failed transition allready exist !';
148
                $response['status']     = false;
149
            // }else{
150
            //     $response['message']    = 'success add new transition';
151
            //     $response['status']     = true;
152
            //     $this->transitionModel->create($request);
153
            // }                
154
        }else{
155
            $response['message']    = 'success add new transition';
156
            $response['status']     = true;
157
            $this->transitionModel->create($request);
158
        }
159
160
        return response()->json($response);
161
    }

src/Http/Controllers/WorkflowController.php 1 location

@@ 114-120 (lines=7) @@
111
            'name'              => 'required'
112
        ]);
113
114
        if($validator->fails()){
115
            $response['message']    = 'failed transition allready exist !';
116
            $response['status']     = false;               
117
        }else{
118
            $response['message']    = 'success add new transition';
119
            $response['status']     = true;                
120
        }
121
122
        //$this->insertWithWorkflow($this->workflowModel, $request);
123
        $this->workflowModel->create($request);