Files
ladill-events/app/Providers/AppServiceProvider.php
T
isaaccladandCursor 6b2d97967a
Deploy Ladill Events / deploy (push) Successful in 2m1s
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 <cursoragent@cursor.com>
2026-07-15 08:14:07 +00:00

37 lines
1.1 KiB
PHP

<?php
namespace App\Providers;
use App\Models\QrCode;
use App\Policies\QrCodePolicy;
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
{
public function register(): void
{
//
}
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());
});
}
}