@props(['plan'])
merge(['class' => 'relative px-5 py-10 flex flex-col gap-4 mx-auto text-center border-2 border-primary-500 rounded-2xl shadow-xl hover:shadow-2xl hover:-translate-y-2 transition'])}}> @if ($plan->product->is_popular)
{{ __('Most popular') }}
@endif {{ $plan->product->name }}
@if($plan->prices[0]->price > 0)
@money($plan->prices[0]->price, $plan->prices[0]->currency->code)
/ {{$plan->interval_count > 1 ? $plan->interval_count : '' }} {{ __($plan->interval->name) }}
@endif @if($plan->prices[0]->type === \App\Constants\PlanPriceType::USAGE_BASED_PER_UNIT->value)
+ @money($plan->prices[0]->price_per_unit, $plan->prices[0]->currency->code) / {{ __($plan->meter->name) }}
@elseif($plan->prices[0]->type === \App\Constants\PlanPriceType::USAGE_BASED_TIERED_GRADUATED->value || $plan->prices[0]->type === \App\Constants\PlanPriceType::USAGE_BASED_TIERED_VOLUME->value)
@php $start = 0; $startingPhrase = __('From'); @endphp @foreach($plan->prices[0]->tiers as $tier)
{{$startingPhrase}} {{ $start }} - {{ $tier[\App\Constants\PlanPriceTierConstants::UNTIL_UNIT] }} {{ __(strtolower(str()->plural($plan->meter->name))) }} @money($tier[\App\Constants\PlanPriceTierConstants::PER_UNIT], $plan->prices[0]->currency->code) / {{ __($plan->meter->name) }} @if ($tier[\App\Constants\PlanPriceTierConstants::FLAT_FEE] > 0) + @money($tier['flat_fee'], $plan->prices[0]->currency->code) @endif
@php $start = intval($tier[\App\Constants\PlanPriceTierConstants::UNTIL_UNIT]) + 1; @endphp @if($plan->prices[0]->type === \App\Constants\PlanPriceType::USAGE_BASED_TIERED_GRADUATED->value) @php $startingPhrase = __('Next'); @endphp @endif @endforeach
@endif
{{ __('Buy') }} {{ $plan->product->name }}