@foreach ($activity_logs as $activity_log) @if (isset($activity_log['properties']) && ($decodedProperties = json_decode($activity_log['properties']))) @php $newAttributes = ''; $oldAttributes = ''; if (isset($decodedProperties->attributes)) { foreach ($decodedProperties->attributes as $key => $field) { if ($field) { $newAttributes .= $key . ' - ' . $field . ', '; } } $newAttributes = rtrim($newAttributes, ', '); } if (isset($decodedProperties->old)) { foreach ($decodedProperties->old as $key => $field) { $oldAttributes .= $key . ' - ' . ($field === null ? 'NULL' : $field) . ', '; } $oldAttributes = rtrim($oldAttributes, ', '); } @endphp @endif @endforeach
Action User Time Changes
NEW OLD
{{ $activity_log['description'] }} {{ isset($activity_log['causer']) ? $activity_log['causer']['name']. ' ' . $activity_log['causer']['last_name'] : '' }} {{ date('M d, Y H:i a', strtotime($activity_log->created_at)) }} {{ $newAttributes }} {{ $oldAttributes }}