Exemplo n.º 1
0
 public function updateUserJob(UserService $user, $user_id, $job_id)
 {
     $retrieve = ['employer', 'title', 'work_start_month', 'work_start_year', 'work_end_month', 'work_end_year', 'work_to_present'];
     try {
         $input = Request::only($retrieve);
         $validation = $user->validateUserJob($input);
         if (!$validation->fails()) {
             $response = $user->updateUserJob($user_id, $job_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()]);
     }
 }