@php // Prefer provided name (from archived row), fallback to related user if still present $name = $employeeName ?? optional($resignation->user)->name ?? 'Employee'; $lwd = optional($resignation->last_working_day)?->format('d M Y'); $exitedAt = optional($resignation->exited_at)?->timezone(config('app.timezone', 'UTC'))?->format('d M Y H:i'); @endphp @component('mail::message') # ✅ Exit Completed — Resignation #{{ $resignation->id }} Dear **{{ $name }}**, Your exit formalities have been completed successfully. Below are your final details: @component('mail::panel') **Employee:** {{ $name }} **Resignation ID:** {{ $resignation->id }} **Applied On:** {{ optional($resignation->resignation_date)?->format('d M Y') ?? 'N/A' }} **Notice Period:** {{ $resignation->notice_period_months }} month(s) **Last Working Day:** {{ $lwd ?? 'N/A' }} **Exit Finalized At:** {{ $exitedAt ?? 'N/A' }} **Status:** {{ $resignation->status }} @endcomponent If you need any paperwork (experience letter, relieving letter, or F&F), please contact **HR**. @component('mail::button', ['url' => url('/resignations/'.$resignation->id)]) View Exit Summary @endcomponent Thanks, **HR Department** {{ config('app.name') }} @endcomponent