Files
ladill-woo-manager/app/Providers/AppServiceProvider.php
T
isaaccladandCursor 09359ca86a
Deploy Ladill Woo Manager / deploy (push) Successful in 39s
Add per-store managers for Woo Business accounts.
Agencies can invite store-scoped managers via Identity, with access limited to one WooCommerce store while owners retain full multi-store control.

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

38 lines
1.3 KiB
PHP

<?php
namespace App\Providers;
use App\Services\Woo\SubscriptionService;
use App\Support\CurrentWooStore;
use App\Support\MobileTopbar;
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', 'partials.mobile-bottom-nav', 'partials.store-switcher-menu', 'partials.store-switcher'], function ($view) {
$account = ladill_account() ?? auth()->user();
$svc = app(SubscriptionService::class);
$stores = app(CurrentWooStore::class);
$storeIds = request()->attributes->get('woo.storeIds');
$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, $storeIds) : collect());
$view->with('currentWooStore', $account ? $stores->resolve($account, $storeIds) : null);
});
View::composer(['partials.topbar'], function ($view) {
$view->with(MobileTopbar::resolve());
});
}
}