From 6b2d97967ac1bca8a92d147dc422568c452c6e82 Mon Sep 17 00:00:00 2001 From: isaacclad Date: Wed, 15 Jul 2026 08:14:07 +0000 Subject: [PATCH] Fix Events /pro 500 and align Plans UI with Accounting. Use the Events user layout, match the Accounting/Invoice upgrade sidebar CTA, and tolerate a missing subscriptions table until migrate runs. Co-authored-by: Cursor --- app/Providers/AppServiceProvider.php | 15 ++++- app/Services/Events/SubscriptionService.php | 5 ++ resources/views/events/pro/index.blade.php | 73 ++++++++++++++++----- resources/views/partials/sidebar.blade.php | 18 +++-- 4 files changed, 86 insertions(+), 25 deletions(-) diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index ac11018..4ca60af 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -4,10 +4,11 @@ namespace App\Providers; use App\Models\QrCode; use App\Policies\QrCodePolicy; -use Illuminate\Support\Facades\Gate; -use Illuminate\Support\ServiceProvider; +use App\Services\Events\SubscriptionService; use App\Support\MobileTopbar; +use Illuminate\Support\Facades\Gate; use Illuminate\Support\Facades\View; +use Illuminate\Support\ServiceProvider; class AppServiceProvider extends ServiceProvider { @@ -19,9 +20,17 @@ class AppServiceProvider extends ServiceProvider public function boot(): void { Gate::policy(QrCode::class, QrCodePolicy::class); + + View::composer('partials.sidebar', function ($view) { + $account = function_exists('ladill_account') ? (ladill_account() ?? auth()->user()) : auth()->user(); + $svc = app(SubscriptionService::class); + $view->with('isPro', $account ? $svc->isPro($account) : false); + $view->with('hasPaidPlan', $account ? $svc->hasPaidPlan($account) : false); + $view->with('isEnterprise', $account ? $svc->isEnterprise($account) : false); + }); + View::composer(['partials.topbar', 'partials.topbar-qr'], function ($view) { $view->with(MobileTopbar::resolve()); }); - } } diff --git a/app/Services/Events/SubscriptionService.php b/app/Services/Events/SubscriptionService.php index 5286a16..9866fb3 100644 --- a/app/Services/Events/SubscriptionService.php +++ b/app/Services/Events/SubscriptionService.php @@ -8,6 +8,7 @@ use App\Models\QrEventRegistration; use App\Models\User; use App\Services\Billing\BillingClient; use Illuminate\Support\Carbon; +use Illuminate\Support\Facades\Schema; use Illuminate\Support\Str; class SubscriptionService @@ -31,6 +32,10 @@ class SubscriptionService public function subscriptionFor(User $user): ?ProSubscription { + if (! Schema::hasTable('events_pro_subscriptions')) { + return null; + } + return ProSubscription::where('user_id', $user->id)->first(); } diff --git a/resources/views/events/pro/index.blade.php b/resources/views/events/pro/index.blade.php index 7aa730c..74cd148 100644 --- a/resources/views/events/pro/index.blade.php +++ b/resources/views/events/pro/index.blade.php @@ -1,7 +1,6 @@ - + + Plans @php - $proPrice = number_format($proPriceMinor / 100, 0); - $enterprisePrice = number_format($enterprisePriceMinor / 100, 0); $live = $subscription && $subscription->entitled(); @endphp @@ -21,9 +20,13 @@

Pay monthly from your Ladill wallet, or prepay 6/12/24 months via Paystack.

@if ($gatingActive && ! $live)
- + @foreach ($prepaidMonths as $months) - + @endforeach
@endif @@ -33,12 +36,26 @@
- {{ $isEnterprise ? 'Business' : 'Pro' }} active until {{ $subscription->current_period_end->format('d M Y') }} + {{ $isEnterprise ? 'Business' : 'Pro' }} active + @if ($subscription->current_period_end) + until {{ $subscription->current_period_end->format('d M Y') }} + @endif + @if ($subscription->auto_renew) + · renews from wallet + @else + · prepaid / auto-renew off + @endif
@if ($subscription->auto_renew) -
@csrf
+
+ @csrf + +
@elseif ($subscription->status === 'canceled') -
@csrf
+
+ @csrf + +
@endif
@@ -48,12 +65,16 @@

Free

GHS 0

+

Get started with ticketed events

    -
  • 2 live events
  • -
  • 100 tickets / month
  • -
  • BYO Paystack / Flutterwave / Hubtel
  • +
  • {{ (int) config('events.free.max_live_events', 2) }} live events
  • +
  • {{ (int) config('events.free.max_tickets_per_month', 100) }} tickets / month
  • +
  • Your own Paystack / Flutterwave / Hubtel
  • +
  • 0% Ladill platform fee
- @if ($planKey === 'free')

Current plan

@endif + @if ($planKey === 'free') +

Current plan

+ @endif
@@ -62,15 +83,24 @@
  • Unlimited events
  • Unlimited tickets
  • +
  • BYO payment gateway
  • Priority support
@if ($planKey === 'pro')

Current plan

@elseif ($gatingActive && ! $hasPaidPlan) -
@csrf
+
+ @csrf + +
@foreach ($prepaidMonths as $months) -
@csrf
+
+ @csrf + + + +
@endforeach @endif
@@ -83,18 +113,27 @@
  • Everything in Pro
  • Team seats
  • Advanced attendee tools
  • +
  • Dedicated onboarding
  • @if ($planKey === 'enterprise')

    Current plan

    @elseif ($gatingActive && ! $hasPaidPlan) -
    @csrf
    +
    + @csrf + +
    @foreach ($prepaidMonths as $months) -
    @csrf
    +
    + @csrf + + + +
    @endforeach @endif
    -
    + diff --git a/resources/views/partials/sidebar.blade.php b/resources/views/partials/sidebar.blade.php index 7db4159..fd2c67a 100644 --- a/resources/views/partials/sidebar.blade.php +++ b/resources/views/partials/sidebar.blade.php @@ -32,11 +32,6 @@
    - @php $proActive = request()->routeIs('events.pro.*'); @endphp - - - Plans - @@ -44,5 +39,18 @@ Settings + + @php $proActive = request()->routeIs('events.pro.*'); @endphp + @if (! empty($hasPaidPlan)) + + + {{ ! empty($isEnterprise) ? 'Events Business' : 'Events Pro' }} + + @else + + + Upgrade to Pro + + @endif