@props([ 'subscription' => null, 'buyRoute' => 'subscription.change-plan', 'plan', ]) @inject('planService', 'App\Services\PlanService') @php $price = $planService->getPlanPrice($plan); @endphp
@if($plan->product->is_popular)
{{__('Most Popular')}}
@endif
{{ __($plan->product->name) }}
@if($price->price > 0)
@money($price->price, $price->currency->code)
@if($plan->type === \App\Constants\PlanType::SEAT_BASED->value) {{__('per seat')}} @endif / {{$plan->interval_count > 1 ? $plan->interval_count : '' }} {{ __($plan->interval->name) }}
@endif @if($price->type === \App\Constants\PlanPriceType::USAGE_BASED_PER_UNIT->value)
+ @money($price->price_per_unit, $price->currency->code) / {{ __($plan->meter->name) }}
@elseif($price->type === \App\Constants\PlanPriceType::USAGE_BASED_TIERED_GRADUATED->value || $price->type === \App\Constants\PlanPriceType::USAGE_BASED_TIERED_VOLUME->value)
@php $start = 0; $startingPhrase = __('From'); @endphp @foreach($price->tiers as $tier)
{{$startingPhrase}} {{ $start }} - {{ $tier[\App\Constants\PlanPriceTierConstants::UNTIL_UNIT] }} {{ __(strtolower(str()->plural($plan->meter->name))) }} @money($tier[\App\Constants\PlanPriceTierConstants::PER_UNIT], $price->currency->code) / {{ __($plan->meter->name) }} @if ($tier[\App\Constants\PlanPriceTierConstants::FLAT_FEE] > 0) + @money($tier['flat_fee'], $price->currency->code) @endif
@php $start = intval($tier[\App\Constants\PlanPriceTierConstants::UNTIL_UNIT]) + 1; @endphp @if($price->type === \App\Constants\PlanPriceType::USAGE_BASED_TIERED_GRADUATED->value) @php $startingPhrase = __('Next'); @endphp @endif @endforeach
@endif
    @if($plan->product->features) @foreach($plan->product->features as $feature)
  • {{$feature['feature']}}
  • @endforeach @endif
plan_id === $plan->id ? 'disabled' : ''}} href="{{ route($buyRoute, ['planSlug' => $plan->slug, 'subscriptionUuid' => $subscription?->uuid, 'tenantUuid' => \Filament\Facades\Filament::getTenant()->uuid]) }}"> {{__('Buy')}} {{ $plan->product->name }}

{{ $plan->product->description }}