Show upgrade UI for assessment analytics instead of bare 403.
Deploy Ladill Care / deploy (push) Successful in 41s
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:
@@ -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,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user