@php $logs = $logs ?? $model->auditHistory()->with('user')->limit(50)->get(); @endphp @if($logs->count() > 0)
@foreach($logs as $log)
{{ $log->action_label }} {{ $log->user?->name ?? 'System' }} {{ $log->created_at->format('M d, Y g:i A') }} ({{ $log->created_at->diffForHumans() }})
@if($log->ip_address) {{ $log->ip_address }} @endif
@if($log->action === 'UPDATE' && !empty($log->new_values_array))
Changed fields:
    @foreach($log->new_values_array as $field => $newValue) @if(isset($log->old_values_array[$field]))
  • {{ $field }}: {{ Str::limit($log->old_values_array[$field] ?? 'null', 50) }} {{ Str::limit($newValue ?? 'null', 50) }}
  • @endif @endforeach
@endif
@endforeach
@else

No audit history available

@endif