| Name |
Code |
Department |
Position |
Iqama |
Iqama Expiry |
Passport |
Manager |
Status |
@foreach($employees as $employee)
@php
$expiry = $employee->iqama_expiry_date;
$statusColor = 'bg-gray-100 text-gray-800';
$statusText = 'Far';
if ($expiry) {
if ($expiry->isPast()) {
$statusColor = 'bg-red-100 text-red-800'; $statusText = 'Expired';
} elseif ($expiry->diffInDays(now()) <= 30) {
$statusColor = 'bg-yellow-100 text-yellow-800'; $statusText = 'Near';
} else {
$statusColor = 'bg-green-100 text-green-800'; $statusText = 'Far';
}
}
@endphp
| {{ $employee->first_name }} {{ $employee->last_name }} |
{{ $employee->employee_code }} |
{{ optional($employee->department)->name }} |
{{ optional($employee->designation)->name }} |
{{ $employee->iqama_number }} |
{{ $expiry ? $expiry->format('Y-m-d') : 'N/A' }} ({{ $statusText }})
|
{{ $employee->passport_number }} |
{{ $employee->manager ? ($employee->manager->first_name . ' ' . $employee->manager->last_name) : '' }} |
{{ ucfirst($employee->status) }}
|
@endforeach
{{ $employees->links() }}