From 674993d916ea33ef596d62c8e5f863a63d7ed1fd Mon Sep 17 00:00:00 2001 From: warcooft Date: Thu, 16 May 2024 18:40:24 +0700 Subject: [PATCH 1/2] fix: sessionUserId() still return null --- src/Audits.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Audits.php b/src/Audits.php index b4e98dd..9fe8f23 100644 --- a/src/Audits.php +++ b/src/Audits.php @@ -45,7 +45,7 @@ public function sessionUserId(): int return 0; } - return session($this->config->sessionUserId) ?? 0; + return function_exists('user_id') ? user_id() : null; } /** From 550a0d190fb6d0064aa0a56071a1ad2b466550c7 Mon Sep 17 00:00:00 2001 From: Aselsan Date: Wed, 28 Aug 2024 06:47:20 +0700 Subject: [PATCH 2/2] Update Audits.php --- src/Audits.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Audits.php b/src/Audits.php index 9fe8f23..7e943ff 100644 --- a/src/Audits.php +++ b/src/Audits.php @@ -45,7 +45,7 @@ public function sessionUserId(): int return 0; } - return function_exists('user_id') ? user_id() : null; + return user_id() ?? session($this->config->sessionUserId) ?? 0; } /**