/** * Update the specified resource in storage. * * @param int $id * @return Response */ public function update($id) { $input = \Input::all(); $validation = \Validator::make($input, $this->getRules()); if ($validation->passes()) { $record = $this->Model->find($id)->update($input); return \Redirect::route($this->routeName . 'show', $id); } return \Redirect::route($this->routeName . 'edit', $id)->withInput()->withErrors($validation); }
/** * Get a specific resource. * * @param integer $id * * @return Resource * @throws ModelNotFoundException */ public function getById($id) { return $this->model->find($id); }
/** * Update an existing item * @param int This variable is primary key that wants to update * @return boolean */ public function update($id) { $result = $this->model->find($id)->fill($this->getInput())->save(); return $result; }