@php use App\Enums\Subscription\SubscriptionPlanKeyEnum; use Illuminate\Support\Str; @endphp @extends('layouts.seller.app', ['page' => $menuSeller['subscriptions']['active'] ?? '', 'sub_page' => $menuSeller['subscriptions']['route']['current']['sub_active'] ?? null]) @section('title', __('labels.current_subscription')) @section('header_data') @php $page_title = __('labels.current_subscription'); $page_pretitle = __('labels.subscriptions'); @endphp @endsection @php $breadcrumbs = [ ['title' => __('labels.home'), 'url' => route('seller.dashboard')], ['title' => __('labels.subscriptions'), 'url' => route('seller.subscription-plans.index')], ['title' => __('labels.current_subscription'), 'url' => ''], ]; $currency = $systemSettings['currencySymbol'] ?? ($subscriptionSettings['currencySymbol'] ?? '$'); @endphp @section('seller-content')
@if (!$subscription) @else
{{ $subscription->snapshot?->plan_name }}
{{ $currency }} {{ number_format((float) ($subscription->snapshot?->price ?? 0), 2) }}
{{ __('labels.duration') }}: @php $duration = $subscription->plan?->duration_type === 'unlimited' ? __('labels.unlimited') : ($subscription->snapshot?->duration_days ?? 0) . ' ' . __('labels.days'); @endphp {{ $duration }}
{!! view('partials.status', ['status' => (string) $subscription->status])->render() !!}
{{ __('labels.start_date') }} : {{ optional($subscription->start_date)->format('Y-m-d') ?? '-' }}
{{ __('labels.end_date') }} : {{ optional($subscription->end_date)->format('Y-m-d') ?? '-' }}

{{ __('labels.plan_configurations') }}

{{ $subscription->plan?->description }}

@php $limitMap =$subscription->snapshot->limits_json ?? []; @endphp
@foreach (SubscriptionPlanKeyEnum::values() as $key) @php $detail = $usageDetails[$key] ?? [ 'limit' => $limitMap[$key] ?? null, 'used' => 0, 'remaining' => null, ]; $limitVal = $detail['limit']; $usedVal = $detail['used'] ?? 0; $remainingVal = $detail['remaining']; @endphp @endforeach
{{ __('labels.configuration') }} {{ __('labels.limit') }} {{ __('labels.used') }} {{ __('labels.remaining') }}
{{ Str::replace('_', ' ', $key) }} {{ $limitVal === null ? __('labels.unlimited') : (int) $limitVal }} {{ (int) $usedVal }} {{ $remainingVal === null ? __('labels.unlimited') : (int) $remainingVal }}
@endif
@endsection