rapyd-laravel icon indicating copy to clipboard operation
rapyd-laravel copied to clipboard

Preprocess, Observer ?

Open arsenik opened this issue 8 years ago • 3 comments

I am trying to figure out how do something with the saved model before or after data are persisted in database (it does not matter as long as I know what was the model values before and after ).

I though about using an Observer but I need to know the action was made from Panel.

I overrided process but model original values are already updated at this point.

class MyUserDataEdit extends \Zofe\Rapyd\DataEdit\DataEdit
{
    protected function process() {
          // do something with $this->model
          parent::process();

}

Any idea where I can do that?

arsenik avatar Feb 25 '17 08:02 arsenik

The easiest thing is to use YourModel::saving() and YourModel::saved();

tacone avatar Feb 28 '17 08:02 tacone

@tacone Actually it won't help because I need to know the action was made from Panel.

arsenik avatar Feb 28 '17 09:02 arsenik

ping @zofe

tacone avatar Mar 01 '17 15:03 tacone