@props([ 'applicant', 'field' ]) @php $fieldLogs = $applicant->logs->where('field', $field); $formatLogValue = function($value) { if ($value === null) return 'Pending'; if ($value === 0 || $value === '0') return 'No'; if ($value === 1 || $value === '1') return 'Yes'; return $value; }; @endphp @if($fieldLogs->count())
@foreach($fieldLogs as $log)
{{ $log->user->full_name ?? 'System' }} changed from {{ $formatLogValue($log->old_value) }} to {{ $formatLogValue($log->new_value) }} ({{ $log->created_at->format('Y-m-d H:i A') }})
@endforeach
@endif