@if (session('success'))
{{ session('success') }}
@elseif(session('error'))
{{ session('error') }}
@endif
@if ($errors->any())
@foreach ($errors->all() as $error)
- {{ $error }}
@endforeach
@endif
@if($OverseasResource && $OverseasResource->changed_fields)
@php
$changes = json_decode($OverseasResource->changed_fields, true);
$skipFields = ['resource_id','status','updated_by','created_at','updated_at'];
function pretty($field, $value) {
if($value === null || $value === '') return '-';
// Format dates
if(strtotime($value)) {
return date('d M Y', strtotime($value));
}
// Convert dropdown IDs to names
if($field == 'region') return \App\Models\RegionName::find($value)->name ?? $value;
if($field == 'department') return \App\Models\Department::find($value)->name ?? $value;
if($field == 'designation') return \App\Models\Designation::find($value)->name ?? $value;
if($field == 'employee_status') return \App\Models\ResourceStatus::find($value)->name ?? $value;
// Show files nicely
if(str_contains($value, 'uploads/')) {
return '
View File';
}
// Pretty print child JSON
if($field == 'child_details') {
return '
'.json_encode(json_decode($value, true), JSON_PRETTY_PRINT).'
';
}
return e($value);
}
@endphp
🔄 Pending Profile Changes
| Field |
Previous |
Requested |
@foreach($changes as $field => $value)
@continue(in_array($field, $skipFields))
| {{ ucfirst(str_replace('_',' ',$field)) }} |
{!! pretty($field, $value['old'] ?? '-') !!} |
{!! pretty($field, $value['new'] ?? '-') !!} |
@endforeach
@endif