/** * Update the specified resource in storage. * * @param HeaderEditFormRequest $request * * @return Response */ public function updateFa(HeaderEditFormRequest $request, $rp_id, $header_id, $id_facultative) { if ($this->repository->updateHeaderFacultative($request, decode($header_id))) { $mail = new MailController($request->user()); $this->facultativeRepository->approved = 2; $this->facultativeRepository->sendProcessMail($mail, $rp_id, $id_facultative, true); return redirect()->route('home')->with(['success_header' => 'La Póliza fue actualizada con éxito.']); } return redirect()->back()->with(['error_header' => 'La Póliza no pudo ser actualizada.'])->withInput()->withErrors($this->repository->getErrors()); }