From 7b429831ce9b59b75d85b225a1f24ff31e3c88be Mon Sep 17 00:00:00 2001 From: Dane Everitt Date: Sat, 11 Sep 2021 13:00:53 -0700 Subject: [PATCH] Fix missing user agent headers to store an empty string rather than null value --- app/Models/AuditLog.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/Models/AuditLog.php b/app/Models/AuditLog.php index 1cd942e95..eb306da9c 100644 --- a/app/Models/AuditLog.php +++ b/app/Models/AuditLog.php @@ -120,8 +120,8 @@ class AuditLog extends Model 'server_id' => null, 'action' => $action, 'device' => $request ? [ - 'ip_address' => $request->getClientIp(), - 'user_agent' => $request->userAgent(), + 'ip_address' => $request->getClientIp() ?? '127.0.0.1', + 'user_agent' => $request->userAgent() ?? '', ] : [], 'metadata' => $metadata, ]);