Skip to content

Commit

Permalink
调整 Versionable Trait 中 getVersionUserId 方法逻辑策略 (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
ramzeng authored Jul 5, 2022
1 parent 3893bc0 commit f6b8d76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Versionable.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ public function getVersionModel(): string

public function getVersionUserId()
{
return $this->getAttribute(\config('versionable.user_foreign_key')) ?? auth()->id();
return auth()->id() ?? $this->getAttribute(\config('versionable.user_foreign_key'));
}

/**
Expand Down

0 comments on commit f6b8d76

Please sign in to comment.