Пример #1
0
 /**
  * Update the Profile - Qualifications - Work Experiences.
  *
  * @Patch("profile/qualifications/work-experiences")
  * @Patch("pim/employee-list/{id}/qualifications/work-experiences")
  *
  * @param QualificationsWorkExperienceRequest $request
  * @param WorkExperience $workExperience
  * @return \Illuminate\Http\RedirectResponse
  * @author Bertrand Kintanar
  */
 public function updateWorkExperience(QualificationsWorkExperienceRequest $request, WorkExperience $workExperience)
 {
     $workExperience = $workExperience->whereId($request->get('work_experience_id'))->first();
     if (!$workExperience) {
         return redirect()->to(str_replace('/work-experiences', '', $request->path()))->with('danger', UNABLE_RETRIEVE_MESSAGE);
     }
     try {
         $workExperience->update($request->all());
     } catch (Exception $e) {
         return redirect()->to(str_replace('/work-experiences', '', $request->path()))->with('danger', UNABLE_UPDATE_MESSAGE);
     }
     return redirect()->to(str_replace('/work-experiences', '', $request->path()))->with('success', SUCCESS_UPDATE_MESSAGE);
 }