public function post_index() { if (!DonationForm::is_valid()) { return Redirect::back()->with_input()->with_errors(DonationForm::$validation); } $new_donation = Donation::create(Input::get()); if ($new_donation) { return Redirect::to_action('donations'); } }
/** * undocumented function * * @return void * @author **/ public static function addNew(array $input) { return Donation::create($input); }
/** * Simple function to create a donation associated with this Registration * * @param array $data * @return Donation */ public function createDonation($data) { $donation = new Donation($this->client, $data, $this->event, $this); $donation->create(); $this->setDonation($donation); return $donation; }