{{-- What one product sells. Retired plans are listed too, marked as such: a withdrawn plan keeps serving the subscriptions already on it, so hiding it would hide the price somebody is still being charged. --}}
@php //A registered product's plan also says what an account on it may //do in the product. Shown only where the product has something a //plan can set; for any other product a plan is a price and a term. $grants = ($integration ?? null) !== null && ($integration->featureKeys() !== [] || $integration->limitKeys() !== []); @endphp
@if ($grants) @endif @forelse ($plans as $plan) @if ($grants) @php $granted = is_array($plan->entitlements) ? $plan->entitlements : []; $features = count(array_intersect($integration->featureKeys(), is_array($granted['features'] ?? null) ? $granted['features'] : [])); $limits = count(array_intersect_key(is_array($granted['limits'] ?? null) ? $granted['limits'] : [], array_flip($integration->limitKeys()))); @endphp @endif @empty @endforelse
Plan Price Billed TrialGrantsState Actions
{{ $plan->name }} {{ $plan->slug }} {{ $plan->currency }} {{ number_format((float) $plan->price, 2) }} {{ $plan->billing_interval?->termLabel((int) $plan->billing_interval_count) ?? '—' }} {{ ($plan->trial_days ?? 0) > 0 ? $plan->trial_days.' days' : 'None' }} @if ($features + $limits === 0) {{-- Not "nothing": the product applies its own floor, and says so. --}} Nothing set @else @if ($integration->featureKeys() !== []) {{ $features }} {{ Str::plural('feature', $features) }} · @endif {{-- How many of them, so a ceiling left at the product's own floor by oversight shows as a gap. --}} @if ($integration->limitKeys() !== []) {{ $limits }} of {{ count($integration->limitKeys()) }} limits @endif @endif @if ($plan->trashed()) Retired @elseif ($plan->is_active) Active @else Inactive @endif @if ($grants) What it grants @endif @unless ($plan->trashed()) Edit @endunless

{{ $product->name }} has no plans yet

A product cannot be sold until it has one.

Add the first plan