Пример #1
0
 /**
  * Delete the profile qualifications work experience.
  *
  * @Delete("ajax/profile/qualifications/work-experience")
  * @Delete("ajax/pim/employee-list/{id}/qualifications/work-experience")
  *
  * @param QualificationsWorkExperienceRequest $request
  * @author Bertrand Kintanar
  */
 public function deleteWorkExperience(QualificationsWorkExperienceRequest $request)
 {
     if ($request->ajax()) {
         $workExperienceId = $request->get('id');
         try {
             WorkExperience::whereId($workExperienceId)->delete();
             print 'success';
         } catch (Exception $e) {
             print 'failed';
         }
     }
 }
Пример #2
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);
 }