From f6b8d76463bd428c90fab9050c7aa314c26baa4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9B=BE=E6=98=AF=E7=84=B6?= <38133602+ranpro@users.noreply.github.com> Date: Tue, 5 Jul 2022 15:08:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=20Versionable=20Trait=20?= =?UTF-8?q?=E4=B8=AD=20getVersionUserId=20=E6=96=B9=E6=B3=95=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E7=AD=96=E7=95=A5=20(#35)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Versionable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Versionable.php b/src/Versionable.php index e4eb785..2d3fb9d 100644 --- a/src/Versionable.php +++ b/src/Versionable.php @@ -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')); } /**