]> BookStack Code Mirror - bookstack/blobdiff - app/Actions/ActivityService.php
Applied StyleCI changes, added php/larastan to attribution
[bookstack] / app / Actions / ActivityService.php
index dce7dc7b2595df00a1652bcfbcce7124de811b62..bc7a6b6b7c3353f39384ae73d88eaca284d5ed41 100644 (file)
@@ -55,9 +55,12 @@ class ActivityService
      */
     protected function newActivityForUser(string $type): Activity
     {
+        $ip = request()->ip() ?? '';
+
         return $this->activity->newInstance()->forceFill([
             'type'     => strtolower($type),
             'user_id'  => user()->id,
+            'ip'       => config('app.env') === 'demo' ? '127.0.0.1' : $ip,
         ]);
     }