diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 22c6c0a..d6be4ca 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -22,7 +22,14 @@ class AppServiceProvider extends ServiceProvider { Event::listen(ServiceEventOccurred::class, PlatformServiceEventListener::class); - View::composer(['partials.sidebar', 'partials.topbar-desktop-widgets', 'partials.afia', 'components.app-layout'], function ($view) { + View::composer([ + 'partials.sidebar', + 'partials.topbar-desktop-widgets', + 'partials.afia', + 'partials.upgrade-banner', + 'care.dashboard', + 'components.app-layout', + ], function ($view) { /** @var User|null $user */ $user = auth()->user(); $planKey = 'free'; diff --git a/config/care.php b/config/care.php index 7d66f82..f5dbe2f 100644 --- a/config/care.php +++ b/config/care.php @@ -320,9 +320,18 @@ return [ ], 'upgrade_banner' => [ - 'title' => 'Unlock Care Pro or Enterprise', - 'description' => 'Pro from GHS 2490/branch/mo — lab, pharmacy, billing, and Queue. Enterprise adds custom multi-dept workflows, analytics, priority support, and AI-assisted healthcare integration.', - 'route' => 'care.pro.index', + 'free' => [ + 'title' => 'Unlock Care Pro or Enterprise', + 'description' => 'Pro from GHS 2490/branch/mo — lab, pharmacy, billing, and Queue. Enterprise adds custom multi-dept workflows, analytics, priority support, and AI-assisted healthcare integration.', + 'route' => 'care.pro.index', + 'cta' => 'View plans', + ], + 'pro' => [ + 'title' => 'Upgrade to Care Enterprise', + 'description' => 'Enterprise from GHS 4990/branch/mo — custom multi-dept workflows, assessment analytics, priority support, and AI-assisted healthcare integration on top of your Pro modules.', + 'route' => 'care.pro.index', + 'cta' => 'View Enterprise', + ], ], ]; diff --git a/resources/views/partials/upgrade-banner.blade.php b/resources/views/partials/upgrade-banner.blade.php index 4ee1ee1..8619247 100644 --- a/resources/views/partials/upgrade-banner.blade.php +++ b/resources/views/partials/upgrade-banner.blade.php @@ -1,13 +1,18 @@ @php - $banner = config('care.upgrade_banner'); $canSeeBilling = \App\Support\StaffUx::showBilling(auth()->user()); + $plan = $planKey ?? 'free'; + $banner = match ($plan) { + 'pro' => config('care.upgrade_banner.pro'), + 'free' => config('care.upgrade_banner.free'), + default => null, + }; @endphp -@if ($canSeeBilling && empty($hasPaidPlan) && ! empty($banner)) +@if ($canSeeBilling && ! empty($banner))
{{ $banner['title'] }}
{{ $banner['description'] }}