Exemple #1
0
 /**
  * Store a newly created resource in storage.
  *
  * @param HeaderCreateFormRequest $request
  * @param string                  $rp_id
  *
  * @return Response
  */
 public function store(HeaderCreateFormRequest $request, $rp_id)
 {
     if ($this->repository->createHeader($request)) {
         $header = $this->repository->getModel();
         return redirect()->route('de.client.list', ['rp_id' => $rp_id, 'header_id' => encode($header->id)])->with(['success_header' => 'La cotización fue registrada con éxito.']);
     }
     return redirect()->back()->with(['error_header' => 'La cotización no pudo ser registrada'])->withInput()->withErrors($this->repository->getErrors());
 }