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