@extends('layouts.app') @section('content')
{{-- Current Subscription Section --}} @if(isset($currentSubscription) && $currentSubscription)

Current Subscription

{{ $currentSubscription['data']['name'] }}

{{ $currentSubscription['data']['description'] }}

Status: {{ ucfirst($currentSubscription['data']['status']) }}

Price: KES {{ number_format($currentSubscription['data']['price']) }}

{{-- the value ends_at is null for lifetime plans --}} @if($currentSubscription['data']['ends_at'])

Start Date: {{ \Carbon\Carbon::parse($currentSubscription['data']['starts_at'])->timezone(config('app.timezone'))->format('M d, Y H:i:s') }}

@else

Start Date: {{ \Carbon\Carbon::parse($currentSubscription['data']['starts_at']) ->timezone(config('app.timezone')) ->format('M d, Y H:i:s') }}

@endif

{{-- the value ends_at is null for lifetime plans --}} @if($currentSubscription['data']['ends_at'])

End Date: {{ \Carbon\Carbon::parse($currentSubscription['data']['ends_at'])->timezone(config('app.timezone')) ->format('M d, Y H:i:s') }}

@else

End Date: (Lifetime)

@endif

Days Remaining: {{-- number of days are shown as negatives yet its a future date and also should be whole number --}} @if($currentSubscription['data']['ends_at']) {{ (int) now()->diffInDays(\Carbon\Carbon::parse($currentSubscription['data']['ends_at']), false) }} days @else (Lifetime) @endif

@else {{-- No Active Subscription --}}
No Active Subscription

You are currently on the free tier. Subscribe to a plan to unlock all features.

@endif

Subscription Plan and Pricing

Try Flaresend WhatsApp API for free. Upgrade for more usage and exclusive features.

{{-- Pricing Plans Section --}}
@foreach($plans as $plan) @php $isCurrent = isset($currentSubscription) && $currentSubscription && $currentSubscription['data']['plan_id'] == $plan['id']; @endphp
{{-- Badges --}} @if($plan['is_popular']) Popular @endif @if($isCurrent) Current Plan @endif {{-- Card Body --}}

{{ $plan['name'] }}

{{ $plan['description'] }}

@if (!empty($plan['is_custom_pricing']) && $plan['is_custom_pricing'])
Contact Us
@else
KES {{ number_format($plan['price']) }}
/ {{ $plan['duration_days'] }} days @endif
Features:
    @foreach($plan['features'] as $feature)
  • {{ $feature }}
  • @endforeach
{{-- Buttons --}}
@if($isCurrent) @else @if ($plan['price'] > 0) @if (!empty($plan['is_custom_pricing']) && $plan['is_custom_pricing']) @else @endif @endif @endif
@endforeach
{{-- Cancel Subscription Modal --}} {{-- --}}
@endsection