]> BookStack Code Mirror - bookstack/blobdiff - app/Actions/ActivityLogger.php
Guest create page: name field autofocus
[bookstack] / app / Actions / ActivityLogger.php
index 468bb47055c995a9faaab7535e5451cf11dcf4cd..6ece47fd5ba6058fb24c89d0e891a1d18455c124 100644 (file)
@@ -40,12 +40,10 @@ class ActivityLogger
      */
     protected function newActivityForUser(string $type): Activity
     {
-        $ip = request()->ip() ?? '';
-
         return (new Activity())->forceFill([
             'type'     => strtolower($type),
             'user_id'  => user()->id,
-            'ip'       => config('app.env') === 'demo' ? '127.0.0.1' : $ip,
+            'ip'       => IpFormatter::fromCurrentRequest()->format(),
         ]);
     }