Files
ladill-woo-manager/app/Providers/AppServiceProvider.php
T
isaaccladandCursor 93bfc3e2d2
Deploy Ladill Woo Manager / deploy (push) Successful in 1m7s
Reorganize Woo Manager mobile header and store switcher placement.
Desktop store switcher now sits after search; mobile shows route-based page titles, bottom nav, and store switching inside the profile sheet.

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

37 lines
1.2 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'], 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);
});
View::composer(['partials.topbar'], function ($view) {
$view->with(MobileTopbar::resolve());
});
}
}