@extends('layouts.app') @section('title', $account->name . ' — Corporate Scheme') @section('content') @php $corpManage = auth()->user() && auth()->user()->hasAnyRole('Super Admin', 'Hospital Admin', 'Corporate Scheme Admin', 'Finance User'); @endphp {{-- ===================== Header ===================== --}}

{{ $account->name }}

{{ $account->code }} {{ $account->scheme_status }}
Contact: {{ $account->contact_person ?? '—' }} · {{ $account->phone ?? '—' }} · {{ $account->email ?? '—' }}
{{-- Member actions (moved up from the members section) --}}
@if($corpManage) @endif
{{-- ===================== Members Section ===================== --}}

Enrolled Members

{{-- Filters --}}
Reset
{{-- Members Table --}}
@forelse ($members as $m) @empty @endforelse
Member # MRN Name Type Principal Of Last Paid Next Due Status Actions
{{ $m->member_number }} {{ $m->patient?->mrn ?? '—' }} {{ $m->patient ? trim($m->patient->first_name . ' ' . $m->patient->last_name) : '—' }} {{ ucfirst($m->member_type) }} {{ $m->principal?->member_number ?? '—' }} {{ $m->last_paid_month ?? '—' }} {{ $m->next_due_date?->format('d M Y') ?? '—' }} @php $badge = match ($m->status) { 'Active' => 'badge-success', 'Grace Period' => 'badge-warning', 'Pending' => 'badge-info', default => 'badge-danger', }; @endphp {{ $m->status }}
@if($m->status === 'Pending') @if($m->enrolment_source === 'public_form') SELF @endif @if($corpManage)
@csrf
@endif @endif Check
No members enrolled yet. Click "Enrol Principal" to begin.
@if (method_exists($members, 'links'))
{{ $members->withQueryString()->links() }}
@endif
{{-- ============================================================ ENROL MEMBER MODAL (handles both principal & dependant) ============================================================ --}} {{-- ============================================================ PUBLIC SELF-ENROLMENT MODAL ============================================================ --}} @endsection