@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['title'] }}

{{ $meta['description'] }}

@csrf @method('PUT') @if($instructors->isEmpty())
No instructors available. Create instructors first, then assign them here.
@else
@foreach($instructors as $instructor)
@endforeach
@endif @error('instructor_ids')

{{ $message }}

@enderror @error('primary_instructor_id')

{{ $message }}

@enderror

Primary instructor is shown first on the course page and certificate credits.

Cancel