public function attempt_edit($id)
	{
		$Model  = App::make($this->Model);
		$object = $Model::withTrashed()->findOrFail($id);

		$errors = $object->validate();
		if (count($errors)) {
			return Redirect::to($this->uri('edit/' . $id))->withInput()->withErrors($errors);
		}

		$object->save();

		return $this->edit_redirect($object);
	}
public function attempt_edit($id)
	{
		$Model  = App::make($this->Model);
		$object = $Model::withTrashed()->findOrFail($id);

		$errors = $object->validate();
		if (count($errors)) {
			return Redirect::to($this->uri('edit/' . $id))->withInput()->withErrors($errors);
		}

		$object->save();

		return $this->edit_redirect($object);
	}
public function attempt_edit ( $ id ) { $ Model = App :: make ( $ this -> Model ) ; $ object = $ Model :: withTrashed ( ) -> findOrFail ( $ id ) ; $ errors = $ object -> validate ( ) ; if ( count ( $ errors ) ) { return Redirect :: to ( $ this -> uri ( 'edit/' . $ id ) ) -> withInput ( ) -> withErrors ( $ errors ) ; } $ object -> save ( ) ; return $ this -> edit_redirect ( $ object ) ; }
Edit a model.

When attempting to edit a model, we simply call validate() on it
and then save it.  All models that extend AngelModel have a saving()
model event that calls the assign() method and fills the model's columns/properties
from the posted inputs.

@param int $id - The ID of the model we're editing.
@return $this->edit_redirect() - Where to go after a successful edit?
Edit a model .