From a12585b7f0c6ce0090feb0110c1ebfeae909e271 Mon Sep 17 00:00:00 2001 From: Dr Masroor Ehsan Date: Tue, 31 Dec 2024 12:13:46 +0600 Subject: [PATCH] url to path --- app/Services/AuditTrail/ActivityLogger.php | 27 +++++++++++----------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/app/Services/AuditTrail/ActivityLogger.php b/app/Services/AuditTrail/ActivityLogger.php index 31a8063..636388e 100644 --- a/app/Services/AuditTrail/ActivityLogger.php +++ b/app/Services/AuditTrail/ActivityLogger.php @@ -75,7 +75,7 @@ public function category(int $category): static public function url(?string $url = null): static { - $this->url = $url ?? request()->url(); + $this->url = $url ?? request()->path(); return $this; } @@ -127,17 +127,18 @@ public function log(bool $initDefaults = true): bool } } - return DB::table('audit_logs')->insert([ - 'study_id' => $this->studyId, - 'user_id' => $this->userId, - 'category' => $this->category, - 'activity' => $this->activity, - 'orthanc_uuid' => $this->orthancId, - 'ip_addr' => $this->ipAddr, - 'user_agent' => $this->userAgent, - 'url' => $this->url, - 'notes' => $this->notes, - 'created_at' => now(), - ]); + return DB::table('audit_logs') + ->insert([ + 'study_id' => $this->studyId, + 'user_id' => $this->userId, + 'category' => $this->category, + 'activity' => $this->activity, + 'orthanc_uuid' => $this->orthancId, + 'ip_addr' => $this->ipAddr, + 'user_agent' => $this->userAgent, + 'url' => $this->url, + 'notes' => $this->notes, + 'created_at' => now(), + ]); } }