From 8efaeb068b89de5181e38368fe592fbd555d07be Mon Sep 17 00:00:00 2001 From: Zero Date: Fri, 27 Aug 2021 12:42:02 +0800 Subject: [PATCH] Save user IP to audit log --- app/Actions/ActivityService.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/Actions/ActivityService.php b/app/Actions/ActivityService.php index dce7dc7b2..87cb075ae 100644 --- a/app/Actions/ActivityService.php +++ b/app/Actions/ActivityService.php @@ -11,6 +11,7 @@ use BookStack\Interfaces\Loggable; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Relations\Relation; use Illuminate\Support\Facades\Log; +use Illuminate\Support\Facades\Request; class ActivityService { @@ -58,6 +59,7 @@ class ActivityService return $this->activity->newInstance()->forceFill([ 'type' => strtolower($type), 'user_id' => user()->id, + 'ip' => Request::ip(), ]); }