@extends('layouts.app') @section('header-title', __('Subscription Plans')) @section('content')
@php $current = request()->current_subscription; $expired = request()->subscription_expired; $sellLimit = $current?->sale_limit; $remainingSales = $current?->remaining_sales; @endphp @if ($current) @php $daysLeft = 'Unlimited'; if ($current->ends_at) { $daysLeft = diffInLargestUnit(now(), $current->ends_at); } @endphp
{{ __('Your Subscription:') }} {{ $current->plan->name ?? __('(Unknown Plan)') }}
@if ($expired)

{{ __('Your subscription has expired.') }}

@else

{{ __('Time left:') }} {{ $daysLeft }} | {{ __('Sales left:') }} {{ $remainingSales ?? __('Unlimited') }}

@endif
@else
@endif
@forelse ($subscriptionPlans as $key => $subscriptionPlan) @php $isCurrentPlan = $current && $current->plan_id === $subscriptionPlan->id; $buttonLabel = null; if (! $current) $buttonLabel = __('Choose Plan'); elseif ($isCurrentPlan) $buttonLabel = __('Renew Plan'); else $buttonLabel = __('Change Plan'); @endphp @empty

{{ __('No subscription plans found') }}

@endforelse
{{ $subscriptionPlans->links() }}
@endsection @push('css') @endpush @push('scripts') @endpush