Skip to content

Commit 7874c4c

Browse files
authored
调整 Versionable Trait 中 getVersionUserId 方法逻辑策略 (#35)
1 parent 140251a commit 7874c4c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Versionable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ public function getVersionModel(): string
221221

222222
public function getVersionUserId()
223223
{
224-
return $this->getAttribute(\config('versionable.user_foreign_key')) ?? auth()->id();
224+
return auth()->id() ?? $this->getAttribute(\config('versionable.user_foreign_key'));
225225
}
226226

227227
public function getKeepVersionsCount(): string

0 commit comments

Comments
 (0)