diff --git a/app/Livewire/Profile/AuditLogPage.php b/app/Livewire/Profile/AuditLogPage.php index 45d443b8..b84d3a1b 100644 --- a/app/Livewire/Profile/AuditLogPage.php +++ b/app/Livewire/Profile/AuditLogPage.php @@ -77,8 +77,6 @@ public function clearSelectedLog(): void $this->dispatch('close-modal', 'audit-log-details'); } - // Assuming Toaster is properly imported - /** * Export the filtered audit logs in the specified format. */ @@ -261,9 +259,11 @@ private function filterContext(array $context): array $encryptedFields = $this->getEncryptedFields(); - foreach (array_keys($filteredContext) as $field) { + foreach ($filteredContext as $field => $value) { if (in_array($field, $encryptedFields, true)) { $filteredContext[$field] = '[encrypted]'; + } elseif ($value === null || $value === '') { + unset($filteredContext[$field]); } }