protected function performAfterSave(callable $callback, $key = null)
    {
        if ($key) {
            $this->callbacksToRunAfterSave[$key] = $callback;
        } else {
            $this->callbacksToRunAfterSave[] = $callback;
        }
    }
protected function performAfterSave(callable $callback, $key = null)
    {
        if ($key) {
            $this->callbacksToRunAfterSave[$key] = $callback;
        } else {
            $this->callbacksToRunAfterSave[] = $callback;
        }
    }
protected function performAfterSave ( callable $ callback , $ key = null ) { if ( $ key ) { $ this -> callbacksToRunAfterSave [ $ key ] = $ callback ; } else { $ this -> callbacksToRunAfterSave [ ] = $ callback ; } }
Allows a callback function to be run when the model is saved.

@param callable $callback Callback to run when the model is saved
@param null|string $key Set a key to be able to override this callback with another to prevent multiple callbacks for the same purpose
Allows a callback function to be run when the model is saved .