Fix missing user agent headers to store an empty string rather than null value

This commit is contained in:
Dane Everitt 2021-09-11 13:00:53 -07:00
parent 5e5d7d6689
commit 7b429831ce
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53

View file

@ -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,
]);