Categories
@if (isset($staff))
@foreach ($staff->TrackAssignedStaff as $trackAssignedStaff)
{{ $trackAssignedStaff->category->name_en }}
@endforeach
@endif
@php
use App\Models\TrackType;
$allTrackIds = $staff->TrackAssignedStaff
->pluck('track_type_id')
->flatMap(fn ($ids) => $ids)
->unique()
->filter();
$trackTypes = TrackType::whereIn('id', $allTrackIds)->get();
@endphp
Program Types
@forelse($trackTypes as $track)
{{ $track->name }}
@empty
No program types found
@endforelse
@php
$tracks = $staff->TrackAssignedStaff->pluck('track')->filter()->unique('id');
@endphp
Programs
@forelse ($tracks as $track)
{{ $track->name_en }}
@empty
No programs assigned
@endforelse