@php $assignedIds = collect(old('instructor_ids', $assigned->pluck('id')->all()))->map(fn ($id) => (int) $id)->all(); $primaryFromAssigned = $assigned->first(fn ($instructor) => (bool) ($instructor->pivot->is_primary ?? false)); $primaryId = (int) old('primary_instructor_id', $primaryFromAssigned?->id ?? ($assignedIds[0] ?? 0)); @endphp
{{ $meta['description'] }}