Ladill Care
@php $member = auth()->user() ? app(\App\Services\Care\OrganizationResolver::class)->memberFor(auth()->user()) : null; $permissions = app(\App\Services\Care\CarePermissions::class); $organization = auth()->user() ? app(\App\Services\Care\OrganizationResolver::class)->resolveForUser(auth()->user()) : null; $nav = [ ['name' => 'Dashboard', 'route' => route('care.dashboard'), 'active' => request()->routeIs('care.dashboard'), 'icon' => ''], ]; if ($permissions->can($member, 'patients.view')) { $nav[] = ['name' => 'Patients', 'route' => route('care.patients.index'), 'active' => request()->routeIs('care.patients.*'), 'icon' => '']; } if ($permissions->can($member, 'appointments.view')) { $nav[] = ['name' => 'Appointments', 'route' => route('care.appointments.index'), 'active' => request()->routeIs('care.appointments.*'), 'icon' => '']; $nav[] = ['name' => 'Queue', 'route' => route('care.queue.index'), 'active' => request()->routeIs('care.queue.*') || request()->routeIs('care.consultations.*'), 'icon' => '']; } // Clinical assessments (layered intake / pathways) — on by default; toggle in Settings. $assessmentsEngineOn = $organization && app(\App\Services\Care\CareFeatures::class)->enabled( $organization, \App\Services\Care\CareFeatures::ASSESSMENTS_ENGINE, ); if ($assessmentsEngineOn && $permissions->can($member, 'assessments.view') && $permissions->can($member, 'patients.view')) { $nav[] = [ 'name' => 'Clinical forms', 'route' => route('care.patients.index', ['focus' => 'assessments']), 'active' => request()->routeIs('care.assessments.*') || request()->routeIs('care.pathways.*') || request()->routeIs('care.outcomes.*'), 'icon' => '', ]; } // Lab, pharmacy, billing, and Queue service counters are Pro/Enterprise modules. if (! empty($hasPaidPlan)) { if ($permissions->can($member, 'lab.view')) { $nav[] = ['name' => 'Laboratory', 'route' => route('care.lab.queue.index'), 'active' => request()->routeIs('care.lab.*'), 'icon' => '']; } if ($permissions->can($member, 'prescriptions.view')) { $nav[] = ['name' => 'Pharmacy queue', 'route' => route('care.prescriptions.queue'), 'active' => request()->routeIs('care.prescriptions.*') && ! request()->routeIs('care.pharmacy.*'), 'icon' => '']; } if ($permissions->can($member, 'pharmacy.view')) { $nav[] = ['name' => 'Inventory', 'route' => route('care.pharmacy.drugs.index'), 'active' => request()->routeIs('care.pharmacy.*'), 'icon' => '']; } if ($permissions->can($member, 'bills.view')) { $nav[] = ['name' => 'Billing', 'route' => route('care.bills.index'), 'active' => request()->routeIs('care.bills.*', 'care.obligations.*'), 'icon' => '']; } if ($permissions->can($member, 'reports.finance.view')) { $nav[] = ['name' => 'Reports', 'route' => route('care.reports.index'), 'active' => request()->routeIs('care.reports.*'), 'icon' => '']; } // Always-on Pro/Enterprise surfaces first, then other specialty modules. $specialtyService = app(\App\Services\Care\SpecialtyModuleService::class); if ($organization) { $specialtyService->ensureDefaultModulesProvisioned( $organization, (string) $organization->owner_ref, ); $organization->refresh(); } $specialtyModules = $specialtyService->enabledModulesForMember($organization, $member); $pinnedKeys = $specialtyService->defaultKeysForPaidPlans(); usort($specialtyModules, function (array $a, array $b) use ($pinnedKeys): int { $aPin = in_array($a['key'], $pinnedKeys, true) ? 0 : 1; $bPin = in_array($b['key'], $pinnedKeys, true) ? 0 : 1; if ($aPin !== $bPin) { return $aPin <=> $bPin; } $aOrder = array_search($a['key'], $pinnedKeys, true); $bOrder = array_search($b['key'], $pinnedKeys, true); if ($aOrder !== false || $bOrder !== false) { return ($aOrder === false ? 99 : $aOrder) <=> ($bOrder === false ? 99 : $bOrder); } return strcasecmp( (string) ($a['definition']['nav_label'] ?? $a['definition']['label'] ?? $a['key']), (string) ($b['definition']['nav_label'] ?? $b['definition']['label'] ?? $b['key']), ); }); foreach ($specialtyModules as $item) { $nav[] = [ 'name' => $item['definition']['nav_label'] ?? $item['definition']['label'], 'route' => route('care.specialty.show', $item['key']), 'active' => request()->routeIs('care.specialty.show') && request()->route('module') === $item['key'], 'icon' => '', ]; } } $adminNav = []; if ($permissions->can($member, 'admin.departments.view')) { $adminNav[] = ['name' => 'Departments', 'route' => route('care.departments.index'), 'active' => request()->routeIs('care.departments.*'), 'icon' => '']; } if ($permissions->can($member, 'admin.practitioners.view')) { $adminNav[] = ['name' => 'Practitioners', 'route' => route('care.practitioners.index'), 'active' => request()->routeIs('care.practitioners.*'), 'icon' => '']; } if ($permissions->can($member, 'audit.view')) { $adminNav[] = ['name' => 'Audit log', 'route' => route('care.audit.index'), 'active' => request()->routeIs('care.audit.*'), 'icon' => '']; } $settingsActive = (request()->routeIs('care.settings*') && ! request()->routeIs('care.pro.*')) || request()->routeIs('care.branches.*') || request()->routeIs('care.members.*') || request()->routeIs('care.integrations*') || request()->routeIs('care.devices.*') || request()->routeIs('care.displays.*'); @endphp
@if ($permissions->can($member, 'settings.view')) Settings @endif @php $proActive = request()->routeIs('care.pro.*'); $issueActive = request()->routeIs('care.issues.*'); $isAccountOwner = \App\Support\StaffUx::showBilling(auth()->user()); @endphp @if ($isAccountOwner) @if (! empty($hasPaidPlan)) {{ ! empty($isEnterprise) ? 'Care Enterprise' : 'Care Pro' }} @else Upgrade to Pro @endif @else Report Issue @endif