Skip to content

Commit

Permalink
Merge pull request #79 from warren32/fix/morph-maps-fix
Browse files Browse the repository at this point in the history
Added morph mapping to version model
  • Loading branch information
nonoesp authored Apr 30, 2021
2 parents 434f1d1 + 6066b8f commit e2cb4da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Mpociot/Versionable/VersionableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ protected function versionablePostSave()
$class = $this->getVersionClass();
$version = new $class();
$version->versionable_id = $this->getKey();
$version->versionable_type = get_class($this);
$version->versionable_type = method_exists($this, 'getMorphClass') ? $this->getMorphClass() : get_class($this);
$version->user_id = $this->getAuthUserId();
$version->model_data = serialize($this->attributesToArray());

Expand Down

0 comments on commit e2cb4da

Please sign in to comment.