/** * Update the specified resource in storage. * * @param int $acProjectId * @param int $id * @return Response */ public function update($acProjectId, $id) { // $this->acTask = $this->acTaskModel->find($id); $this->acTask->fill(Input::except('_method', '_token')); if ($this->acTask->save()) { return Redirect::route('ac_projects.ac_tasks.show', [$acProjectId, $id]); } else { return Redirect::route('ac_projects.ac_tasks.edit', $id)->withErrors($this->acTask->errors())->with('message', 'There were validation errors.'); } }
/** * Update the specified resource in storage. * * @param int $acProjectId * @param int $id * @return Response */ public function update($acProjectId, $id) { // $this->acTask = $this->acTaskModel->find($id); $this->acTask->fill(request()->except('_method', '_token')); try { $this->acTask->save(); return redirect()->route('ac_projects.ac_tasks.show', [$acProjectId, $id]); } catch (Exception $e) { return redirect()->route('ac_projects.ac_tasks.edit', $id)->withErrors($this->acTask->errors())->with('message', 'There were validation errors.'); } }