Code Duplication    Length = 8-8 lines in 2 locations

src/controller/ApiManagerController.php 2 locations

@@ 231-238 (lines=8) @@
228
    		'user_id'		=> 'required',
229
    	]);
230
231
    	if($validator->fails())
232
    	{
233
			return Response::json(array(
234
				'title' => 'Error',
235
				'type'  => 'error',
236
				'message' => $validator->errors()->all()
237
			));
238
    	}
239
240
      try {
241
          $host 			= str_replace(array('https://', 'http://'), array('',''),$request->input('host'));
@@ 477-484 (lines=8) @@
474
    		'request'		=> 'required',
475
    		]);
476
477
    	if($validator->fails())
478
    	{
479
			return Response::json(array(
480
				'title' => 'Error',
481
				'type'  => 'error',
482
				'message' => $validator->errors()->all()
483
			));
484
    	}
485
      if(Auth::guest()){ $current_user = 1; }
486
      else{ $current_user = (Auth::user())?((Auth::user()->id)?Auth::user()->id:1):1; }
487