Ejemplo n.º 1
0
 /**
  * Update the PIM - Termination Reasons.
  *
  * @Patch("pim/configuration/termination-reasons")
  *
  * @param TerminationReasonsRequest $request
  * @return \Illuminate\Http\RedirectResponse
  * @author Bertrand Kintanar
  */
 public function update(TerminationReasonsRequest $request)
 {
     $termination_reason = $this->termination_reason->whereId($request->get('termination_reason_id'))->first();
     if (!$termination_reason) {
         return redirect()->to($request->path())->with('danger', UNABLE_RETRIEVE_MESSAGE);
     }
     try {
         $termination_reason->update($request->all());
     } catch (Exception $e) {
         return redirect()->to($request->path())->with('danger', UNABLE_UPDATE_MESSAGE);
     }
     return redirect()->to($request->path())->with('success', SUCCESS_UPDATE_MESSAGE);
 }
Ejemplo n.º 2
0
 /**
  * Delete the profile qualifications skill.
  *
  * @Delete("ajax/delete-termination-reason")
  *
  * @param TerminationReasonsRequest $request
  * @author Bertrand Kintanar
  */
 public function deleteTerminationReason(TerminationReasonsRequest $request)
 {
     if ($request->ajax()) {
         $terminationReasonId = $request->get('id');
         try {
             TerminationReason::whereId($terminationReasonId)->delete();
             print 'success';
         } catch (Exception $e) {
             print 'failed';
         }
     }
 }