@php $record = $getRecord(); $properties = $record->properties ?? []; $formatValue = function ($val, $key = null) { if (is_null($val)) return 'null'; if (is_bool($val)) return $val ? 'true' : 'false'; if (is_array($val) || is_object($val)) { return json_encode($val, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); } $str = (string) $val; // Format empty HTML tags if ($str === '
' || trim($str) === '') { return '[empty]'; } // Format simple HTML strings if (str_contains($str, '')) { $stripped = strip_tags($str); return empty(trim($stripped)) ? '[empty]' : trim($stripped); } // Parse date strings if (preg_match('/^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}:\d{2}/', $str)) { try { return \Carbon\Carbon::parse($str)->format('M j, Y H:i:s'); } catch (\Exception $e) { // Fallback to original } } return $str; }; $action = $record->action; $attributes = $properties['attributes'] ?? []; $oldValues = $properties['old'] ?? []; @endphp
| Field | Old Value | New Value |
|---|---|---|
| {{ $key }} | @if ($hasOld) @if ($changed) {{ $formatValue($old, $key) }} @else {{ $formatValue($old, $key) }} @endif @else not set @endif | @if ($changed) {{ $formatValue($new, $key) }} @else {{ $formatValue($new, $key) }} @endif |
| No attributes updated. | ||
| Field | Value |
|---|---|
| {{ $key }} | {{ $formatValue($val, $key) }} |
| No attributes recorded. | |