@php $firstGroup = array_key_first($nav); @endphp
{{-- RIGHT: Content (All sections stacked) --}}
@if (session('success'))
{{ session('success') }}
@endif {{-- ================= BASIC INFO ================= --}}

Basic Info

{{-- Row 1 --}}
@error('basic.full_name')
{{ $message }}
@enderror
@error('basic.email')
{{ $message }}
@enderror
{{-- Row 2 --}}
@error('basic.phone')
{{ $message }}
@enderror
{{-- الحقول الخاصة فقط لغير المساعد --}} @if(!$isAssistant)
@error('basic.whatsapp')
{{ $message }}
@enderror
@error('basic.language')
{{ $message }}
@enderror
@error('basic.gender')
{{ $message }}
@enderror
@endif
{{-- ================= MEDICAL (Doctor) ================= --}} @if($isDoctor) {{-- Specialities --}}

Medical Settings — Specialities

@foreach($specialityOptions as $opt) @endforeach
@if(empty($medical['specialties']))
No specialities yet.
@else
@foreach($medical['specialties'] as $i => $spName) {{ $spName }} @endforeach
@endif
{{-- Diagnoses --}}

Predefined Diagnoses

@if(empty($medical['diagnoses']))
No diagnoses yet.
@else
@foreach($medical['diagnoses'] as $i => $diag) {{ $diag }} @endforeach
@endif
{{-- Analyses --}}

Predefined Required Analyses

@if(empty($medical['analyses']))
No analyses yet.
@else
@foreach($medical['analyses'] as $i => $an) {{ $an }} @endforeach
@endif
{{-- Prescriptions --}}
{{-- … --}}

Predefined Prescription Items

@foreach($medOptions as $opt) @endforeach @if(empty($medical['prescriptions']))
No items yet.
@else
@foreach($medical['prescriptions'] as $pi => $row) @endforeach
Medicine Dosage Notes Conflicts
@endif
{{-- General Services --}}

General Services (Shared)

@forelse($generalServices as $gi => $gs) @empty @endforelse
Service Name Speciality Price
@error("generalServices.$gi.name")
{{ $message }}
@enderror
@error("generalServices.$gi.speciality_id")
{{ $message }}
@enderror
@error("generalServices.$gi.price")
{{ $message }}
@enderror
No general services yet.

Medical Settings — Prescription Template

@foreach($rxTemplates as $tpl) @php // لو مفيش ملف blade، اعرض صفحة معاينة بديلة (اعملي route لها أو خليه أي static) $src = $tpl['preview_url'] ?: url('/admin/prescription-templates/preview/_not_found'); @endphp
@endforeach
{{-- Lightbox --}}
@endif {{-- ================= CLINICS (placeholder shortcut) ================= --}}

Clinics

Clinics, Assistants, and clinic-specific services are managed in the Clinics module.
{{-- ================= NOTIFICATIONS ================= --}}

Notification Settings

{{-- ================= ADVERTISING ================= --}}

Advertising — Profile

Advertising — Media
Advertising — Templates
{{-- ================= TECHNICAL ================= --}}

Technical Settings

@foreach($technical['widgets'] as $k => $v)
@endforeach
{{-- ================= ADMINISTRATIVE ================= --}}

Administrative Settings

Define assistants’ privileges here. (UI ready — persistence will be wired to DB later.)
@livewire('client.setting.admin.admin-roles', ['doctorId' => $doctorId], key('admin-roles-'.$doctorId))
{{-- ================= SECURITY ================= --}}

Security

@error('new_password')
{{ $message }}
@enderror
{{-- ================= PRIVACY (Patient) ================= --}}

Sharing with Doctors

{{-- --}}
{{-- ================= ADD-ONS (Dynamic) ================= --}} @if($isDoctor && !empty($addonSubscriptions) && $addonSubscriptions->count()) @foreach($addonSubscriptions as $sub) @php $slug = trim((string)($sub->addon->slug ?? ('addon-'.$sub->addon_id))); $groupKey = 'addon:' . Str::slug($slug, '-'); // ← مفتاح الجروب في الـ nav $childKey = 'addon-' . Str::slug($slug, '-'); // ← ID للـ section + child الوحيد $name = $sub->addon->name ?? 'Addon'; $active = method_exists($sub,'isActive') ? $sub->isActive() : (($sub->status ?? false) && optional($sub->expires_at)->isFuture()); $badgeClr = $sub->status_badge_color ?? ($active ? 'success' : 'warning'); $badgeLbl = $sub->status_label ?? ($active ? 'Active' : 'Expired'); @endphp

{{ $name }}

{{ $badgeLbl }}
{{ optional($sub->starts_at)->format('d M Y') }} → {{ optional($sub->expires_at)->format('d M Y') }} @if(property_exists($sub, 'days_left') || isset($sub->days_left)) @if($sub->days_left > 0) ({{ $sub->days_left }} days left) @else (expired) @endif @endif
{{-- تحميل الكومبوننت الخاص بالـ Add-on ديناميكياً --}} @php $comp = $this->addonComponentFromSlug($sub->addon->slug ?? null); @endphp @if($comp) @livewire($comp, ['subscription' => $sub, 'doctorId' => $doctorId], key('addon-'.$sub->id)) @else
No specific settings for this add-on yet.
You can add controls here later based on the add-on features.
@endif {{-- أزرار عامة --}}
@if($active) @else @endif
@endforeach @endif