{{-- x-workflow-timeline Props: - histories: Collection of RecruitmentStageHistory models (oldest first) - stages: Ordered stage list (default: WorkflowService::stages()) Displays append-only recruitment workflow history. --}} @props([ 'histories' => collect(), 'stages' => null, ]) @php $histories = collect($histories); $stages = $stages ?? \App\Services\WorkflowService::stages(); $reached = $histories->pluck('stage')->unique()->all(); @endphp
    @foreach ($stages as $stage) @php $done = in_array($stage, $reached, true); @endphp
  1. {{ ucwords(str_replace('_', ' ', $stage)) }} @if ($done) @foreach ($histories->where('stage', $stage) as $history)
    {{ $history->changedBy?->name ?? 'System' }} · {{ $history->changed_at?->format('d-m-Y H:i') ?? 'N/A' }} @if ($history->remarks)
    {{ $history->remarks }}
    @endif
    @endforeach @else
    {{ __('Not reached') }}
    @endif
  2. @endforeach