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 @@
- Pay monthly from your Ladill wallet, or prepay 6/12/24 months via Paystack. Free GHS 0 Get started with ticketed events Current plan Current plan Current plan Current plan
-
- @if ($planKey === 'free')