@php use \Illuminate\Support\Js; @endphp
@foreach($this->getActivities() as $activityItem) @php /* @var \Spatie\Activitylog\Models\Activity $activityItem */ $changes = $activityItem->getChangesAttribute(); @endphp
@if ($activityItem->causer) @endif
{{ $activityItem->causer?->name }} {{ __('filament-activity-log::activities.events.' . $activityItem->event) }} {{ $activityItem->created_at->format(__('filament-activity-log::activities.default_datetime_format')) }}
@if ($this->canRestoreActivity() && $changes->isNotEmpty()) @lang('filament-activity-log::activities.table.restore') @endif
@if ($changes->isNotEmpty()) @foreach (data_get($changes, 'attributes', []) as $field => $change) @php $oldValue = isset($changes['old'][$field]) ? $changes['old'][$field] : ''; $newValue = isset($changes['attributes'][$field]) ? $changes['attributes'][$field] : ''; @endphp $loop->even ]) > @endforeach
{{ __('filament-activity-log::activities.table.field') }} {{ __('filament-activity-log::activities.table.old') }} {{ __('filament-activity-log::activities.table.new') }}
{{ $this->getFieldLabel($field) }} @if(is_array($oldValue))
{{ json_encode($oldValue, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) }}
@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
@endif
@endforeach