@extends('frontend.layouts.user.index') @section('title', __('Checkout — :plan', ['plan' => $plan->name])) @push('styles') @endpush @section('content') @php use App\Enums\BillingCycle; $isUpgrade = $isSwitch && (int) $plan->sort_order > (int) $current->plan->sort_order; $isDowngrade = $isSwitch && (int) $plan->sort_order < (int) $current->plan->sort_order; $headingTitle = match (true) { $isUpgrade => __('Upgrade to :plan', ['plan' => $plan->name]), $isDowngrade => __('Switch to :plan', ['plan' => $plan->name]), $isSwitch => __('Change billing cycle'), default => __('Subscribe to :plan', ['plan' => $plan->name]), }; $headingSub = match (true) { $isUpgrade => __('Unlock more features. We will only charge the prorated difference.'), $isDowngrade => __('Switch to a smaller plan. Unused time on your current plan is credited.'), $isSwitch => __('Adjust your billing cycle. Unused time is applied as credit.'), default => __('Confirm your details and pay from your wallet to activate.'), }; $planIcon = match (true) { $plan->isFree() => 'fas fa-seedling', $plan->is_featured => 'fas fa-crown', default => 'fas fa-rocket', }; @endphp
{{-- Header --}}
{{ __('Back to plans') }}

{{ $headingTitle }}

{{ $headingSub }}

{{ __('Secure wallet checkout') }}
{{-- ─────── LEFT: Plan summary ─────── --}}
{{ __("You're getting") }}

{{ $plan->name }}

{{ $plan->description ?: __('Premium plan with full feature access.') }}

@if($plan->plan_badge) {{ $plan->plan_badge }} @endif
@if($plan->trial_days > 0 || $plan->grace_days > 0)
@if($plan->trial_days > 0) {{ $plan->trial_days }}-{{ __('day free trial') }} @endif @if($plan->grace_days > 0) {{ $plan->grace_days }}-{{ __('day grace period') }} @endif
@endif @if($plan->features->isNotEmpty())
{{ __("What's included") }}
    @foreach($plan->features as $f)
  • {{ $f->feature_label }} @if(! $f->isToggle()) {{ $f->isUnlimited() ? __('Unlimited') : $f->feature_value }} @endif
  • @endforeach
@endif @if($isSwitch)
{{ __('Switching from') }}
{{ $current->plan->name }} @if($current->billing_cycle) · {{ $current->billing_cycle->label() }} @endif
@if($current->current_period_end)
{{ __('Current period ends :date — unused time becomes credit', ['date' => $current->current_period_end->format('d M Y')]) }}
@endif
@endif
{{-- ─────── RIGHT: Order summary ─────── --}}
@endsection