Files
ladill-woo-manager/app/Providers/AppServiceProvider.php
T
isaaccladandCursor cebf0d2e61
Deploy Ladill Woo Manager / deploy (push) Successful in 51s
Add Woo Manager Pro with multi-store switching and free-tier limits.
Free: 1 store and 20 products. Pro/Business mirrors Invoice pricing (GHS 49/149)
with wallet renewals, Paystack prepay, session-based store switcher, and scoped UI.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-07 01:14:08 +00:00

32 lines
1.0 KiB
PHP

<?php
namespace App\Providers;
use App\Services\Woo\SubscriptionService;
use App\Support\CurrentWooStore;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\View;
class AppServiceProvider extends ServiceProvider
{
public function register(): void
{
//
}
public function boot(): void
{
View::composer(['partials.sidebar', 'partials.topbar'], function ($view) {
$account = ladill_account() ?? auth()->user();
$svc = app(SubscriptionService::class);
$stores = app(CurrentWooStore::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->with('wooActiveStores', $account ? $stores->activeStores($account) : collect());
$view->with('currentWooStore', $account ? $stores->resolve($account) : null);
});
}
}