/** * 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); }