@foreach($ordered as $plan)
@php
$isFeatured = $plan->is_featured;
$prices = $plan->prices->keyBy(fn($p) => $p->billing_cycle instanceof BillingCycle ? $p->billing_cycle->value : (string) $p->billing_cycle);
$monthlyAmt = (float) (($prices['monthly'] ?? null)?->price ?? 0);
$planIcon = match(true) {
$monthlyAmt <= 0 => 'fa-solid fa-seedling',
$isFeatured => 'fa-solid fa-crown',
default => 'fa-solid fa-gem',
};
if ($monthlyAmt <= 0) {
$badgeText = $plan->plan_badge ?: __('Free Forever');
} elseif ($isFeatured) {
$badgeText = $plan->plan_badge ?: __('Most Popular');
} else {
$badgeText = $plan->plan_badge;
}
@endphp
@if($isFeatured && $badgeText)
{{ $badgeText }}
@endif
{{ $plan->description ?: __('Access to core platform features.') }}
{{ $currencyCode }}
{{ number_format($monthlyAmt, 0, '.', '') }}
/{{ __('mo') }}
{{ __('Billed monthly') }}
{{ $plan->trial_days > 0 ? __('Start :d-Day Free Trial', ['d' => $plan->trial_days]) : __('Begin Application') }}
{{ __("What's Included") }}
@foreach($plan->features as $feature)
-
{{ $feature->feature_label }}
@if(!$feature->isToggle())
{{ $feature->isUnlimited() ? __('Unlimited') : $feature->feature_value }}
@endif
@endforeach
@endforeach