philipbrown/magniloquent — pull request #36 by Propaganistas (2014-05-20 18:26:41+00:00)
Title: Implement beforeSave()

Hi

Since `Model::saving` and other events only fire **after** Magniloquent's validation, a beforeSave() method would be a great addition. This allows developers to set or change values before effectively validating and saving to the database (e.g. if field is empty, set value as random string `Str::random(6)` ).
The `beforeSave()` method should preferably be called between `$this->fill($new_attributes)` and `if (! $forceSave)` in `save()`.

afterSave() methods seem redundant to me because of the existence of the corresponding events.