@php $mode = $mode ?? 'create'; $isEdit = $mode === 'edit'; $action = $isEdit ? route('admin.services.update', $service) : route('admin.services.store'); $selectedStaffIds = collect(old('staff_profile_ids', $selectedStaffIds ?? []))->map(fn ($id) => (int) $id)->all(); @endphp