@if ($subscription)

{{ $subscription->plan?->name ?? 'Subscription' }}

{{ $subscription->status->label() }}

{{ format_money($subscription->price_cents, $subscription->currency) }} {{ $subscription->billing_interval->suffix() }}

@if ($subscription->onTrial()) Trial ends {{ $subscription->trial_ends_at->format('j M Y') }} @endif
@php $facts = [ ['Devices', $subscription->device_limit], ['Renews', $subscription->auto_renew ? 'Automatically' : 'Cancelled at period end'], ['Expires', $subscription->ends_at?->format('j M Y') ?? 'Open-ended'], ['Days remaining', $subscription->daysRemaining() ?? '—'], ]; @endphp
@foreach ($facts as [$label, $value])
{{ $label }}
{{ $value }}
@endforeach
@if ($subscription->data_limit_bytes)
@php $used = $subscription->data_used_bytes; $limit = $subscription->data_limit_bytes; $pct = min(100, (int) round(100 * $used / max(1, $limit))); @endphp
Data allowance {{ format_bytes($used) }} of {{ format_bytes($limit) }}
@else
Data used this month {{ format_bytes($usageThisMonth) }}
@endif
@else @endif {{-- ============================================================ Plans --}} @if ($plans->isNotEmpty())

{{ $subscription ? 'Change plan' : 'Choose a plan' }}

{{-- Checkout arrives in Phase 4; saying so beats a button that does nothing. --}} Online checkout is not live yet. Contact support to start or change a plan.
@foreach ($plans as $plan)

{{ $plan->name }}

@if ($subscription?->plan_id === $plan->id) Current @endif

{{ format_money($plan->price_cents, $plan->currency) }} {{ $plan->billing_interval->suffix() }}

  • {{ $plan->device_limit }} {{ Str::plural('device', $plan->device_limit) }}
  • {{ $plan->isUnmetered() ? 'Unmetered data' : format_bytes($plan->data_limit_bytes).' per month' }}
  • {{ $plan->has_all_locations ? 'All locations' : 'Selected locations' }}
@endforeach
@endif {{-- ========================================================== History --}} @if ($history->count() > 1)
    @foreach ($history as $entry)
  • {{ $entry->plan?->name ?? 'Plan' }}

    {{ $entry->starts_at?->format('j M Y') }} — {{ $entry->ends_at?->format('j M Y') ?? 'ongoing' }}

    {{ $entry->status->label() }}
  • @endforeach
@endif