route('token') ?? $request->ip(); return Limit::perMinute(30)->by((string) $key); }); View::composer('partials.sidebar', function ($view) { /** @var User|null $user */ $user = auth()->user(); $planKey = 'free'; $isPro = false; $isEnterprise = false; $hasPaidPlan = false; if ($user) { $organization = app(OrganizationResolver::class)->resolveForUser($user); if ($organization) { $plans = app(PlanService::class); $planKey = $plans->planKey($organization); $isPro = $planKey === 'pro'; $isEnterprise = $planKey === 'enterprise'; $hasPaidPlan = $plans->hasPaidPlan($organization); } } $view->with([ 'planKey' => $planKey, 'isPro' => $isPro, 'isEnterprise' => $isEnterprise, 'hasPaidPlan' => $hasPaidPlan, ]); }); View::composer(['partials.topbar'], function ($view) { $view->with(\App\Support\MobileTopbar::resolve()); }); } }