Exemple #1
0
 /**
  * Delete the profile qualifications education.
  *
  * @Delete("ajax/profile/qualifications/education")
  * @Delete("ajax/pim/employee-list/{id}/qualifications/education")
  *
  * @param QualificationsEducationRequest $request
  * @author Bertrand Kintanar
  */
 public function deleteEduction(QualificationsEducationRequest $request)
 {
     if ($request->ajax()) {
         $educationId = $request->get('id');
         try {
             Education::whereId($educationId)->delete();
             print 'success';
         } catch (Exception $e) {
             print 'failed';
         }
     }
 }
 /**
  * Save the Profile - Qualifications - Education.
  *
  * @Post("profile/qualifications/educations")
  * @Post("pim/employee-list/{id}/qualifications/educations")
  *
  * @param QualificationsEducationRequest $request
  * @param Education $education
  * @return \Illuminate\Http\RedirectResponse
  * @author Bertrand Kintanar
  */
 public function storeEducation(QualificationsEducationRequest $request, Education $education)
 {
     try {
         $education->create($request->all());
     } catch (Exception $e) {
         return redirect()->to(str_replace('/educations', '', $request->path()))->with('danger', UNABLE_ADD_MESSAGE);
     }
     return redirect()->to(str_replace('/educations', '', $request->path()))->with('success', SUCCESS_ADD_MESSAGE);
 }