@php use Carbon\Carbon; @endphp @extends('layouts.app') @section('content')

Subscription Plans

Choose a plan that fits your hosting needs

@if($hasSubscription) @php $currentPriceId = $subscription->stripe_price; @endphp
Active Subscription

Subscription ID: {{ $subscription->stripe_id }}

Status: {{ ucfirst($stripeSubscription->status) }}

@php $stripeSubscription = $subscription->asStripeSubscription(); $currentPeriodStart = $stripeSubscription->items->data[0]->current_period_start ?? null; $currentPeriodEnd = $stripeSubscription->items->data[0]->current_period_end ?? null; @endphp

Started:
{{ \Carbon\Carbon::createFromTimestamp($currentPeriodStart)->format('F d, Y h:i A') }}

@if(!$stripeSubscription->cancel_at_period_end)

Next Renewal:
{{ \Carbon\Carbon::createFromTimestamp($currentPeriodEnd)->format('F d, Y h:i A') }}

@endif @if($stripeSubscription->cancel_at_period_end)

Subscription will cancel on {{ \Carbon\Carbon::createFromTimestamp($currentPeriodEnd)->format('F d, Y h:i A') }}

@endif {{-- Download Invioce --}}
View Payment History {{-- Cancel Button --}} @if(!$stripeSubscription->cancel_at_period_end && $stripeSubscription->status === 'active')
@csrf
@endif
@endif
@foreach($plans as $plan)
@if($plan->is_popular) Most Popular @endif
{{ $plan->name }}

{{ $plan->description }}

${{ number_format($plan->price_monthly, 2) }} /month
@if($plan->trial_days > 0)
{{ $plan->trial_days }} Days Free Trial
@endif
    @php $features = is_array($plan->features) ? $plan->features : json_decode($plan->features, true); @endphp @foreach($features as $feature)
  • {{ $feature }}
  • @endforeach
@php $currentPriceId = $hasSubscription ? $subscription->stripe_price : null; $trialUsed = auth()->user()->trial_used ?? false; @endphp
@if($hasSubscription && $currentPriceId === $plan->stripe_price_id_monthly) @elseif($hasSubscription) @if($plan->price_monthly > $currentAmount) @else @if($plan->price_monthly == 0 && $trialUsed) @else @endif @endif @else {{-- Hide trial plan if already used --}} @if($plan->price_monthly == 0 && $trialUsed) @else @endif @endif
@endforeach
@endsection