Skip to content

Commit 7b42983

Browse files
committed
Fix missing user agent headers to store an empty string rather than null value
1 parent 5e5d7d6 commit 7b42983

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/Models/AuditLog.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ public static function instance(string $action, array $metadata, bool $isSystem
120120
'server_id' => null,
121121
'action' => $action,
122122
'device' => $request ? [
123-
'ip_address' => $request->getClientIp(),
124-
'user_agent' => $request->userAgent(),
123+
'ip_address' => $request->getClientIp() ?? '127.0.0.1',
124+
'user_agent' => $request->userAgent() ?? '',
125125
] : [],
126126
'metadata' => $metadata,
127127
]);

0 commit comments

Comments
 (0)