Fix Events /pro 500 and align Plans UI with Accounting.
Deploy Ladill Events / deploy (push) Successful in 2m1s
Deploy Ladill Events / deploy (push) Successful in 2m1s
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 <cursoragent@cursor.com>
This commit is contained in:
@@ -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());
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user