Show upgrade UI for assessment analytics instead of bare 403.
Deploy Ladill Care / deploy (push) Successful in 41s

Non-Enterprise orgs hitting /reports/assessments get the in-app plans upsell; CSV export redirects to View plans with an upsell flash.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
isaacclad
2026-07-20 16:26:43 +00:00
co-authored by Cursor
parent d4b645d85b
commit cebc9c8e4c
4 changed files with 50 additions and 10 deletions
@@ -11,12 +11,16 @@ trait RequiresPlanFeature
{
/**
* For page views: return an upgrade screen when the org lacks the feature.
*
* @param 'pro'|'enterprise' $planHint Which tier to highlight in pricing copy
*/
protected function proFeatureUpgradeView(
Request $request,
string $feature,
string $title,
string $description,
string $planHint = 'pro',
?string $upgradeBody = null,
): ?View {
$organization = $this->organization($request);
$plans = app(PlanService::class);
@@ -25,11 +29,17 @@ trait RequiresPlanFeature
return null;
}
$isEnterprise = $planHint === 'enterprise';
return view('care.settings.pro-feature', [
'organization' => $organization,
'title' => $title,
'description' => $description,
'proPriceMinor' => $plans->proPricePerBranchMinor(),
'planLabel' => $isEnterprise ? 'Enterprise' : 'Pro',
'proPriceMinor' => $isEnterprise
? $plans->enterprisePricePerBranchMinor()
: $plans->proPricePerBranchMinor(),
'upgradeBody' => $upgradeBody,
]);
}