diff --git a/readme.md b/readme.md index 4fd6c5d..54b275d 100644 --- a/readme.md +++ b/readme.md @@ -1,8 +1,4 @@ -
| + {{ __('filament-activity-log::activities.table.field') }} + | ++ {{ __('filament-activity-log::activities.table.old') }} + | ++ {{ __('filament-activity-log::activities.table.new') }} + | + + + + @foreach (data_get($changes, 'attributes', []) as $field => $change) + @php + $oldValue = data_get($changes, "old.{$field}", ''); + $newValue = data_get($changes, "attributes.{$field}", ''); + @endphp +
|---|---|---|
| + {{ $this->getFieldLabel($resource, $field) }} + | +
+ @if(is_array($oldValue))
+ {{ json_encode($oldValue, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) }}
+ @elseif (is_bool($oldValue))
+ {{ $oldValue ? 'true' : 'false' }}
+ @else
+ {{ $oldValue }}
+ @endif
+ |
+
+ @if (is_bool($newValue))
+ {{ $newValue ? 'true' : 'false' }}
+ @elseif(is_array($newValue))
+ {{ json_encode($newValue, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) }}
+ @else
+ {{ $newValue }}
+ @endif
+ |
+