public function updateStudy(UserService $user, $user_id, $study_id) { $retrieve = ['school_name', 'degree', 'attainment_id', 'school_start_month', 'school_start_year', 'school_end_month', 'school_end_year', 'study_to_present']; try { $input = Request::only($retrieve); $validation = $user->validateUserStudy($input); if (!$validation->fails()) { $response = $user->updateUserStudy($user_id, $study_id, $input); if (!empty($response)) { return $this->json_response->success($response); } return $this->json_response->error($response); } else { return $this->json_response->error(['validation_message' => $validation->messages()]); } } catch (Exception $e) { return $this->json_response->error(['error' => $e->getMessage()]); } }