@include('frontend.partials.head', ['title' => 'Fily | Subscription']) @include('frontend.dashboard.partials.styles') @php $planCollection = collect($plans ?? []); $activeSubscriptionCollection = collect($activeSubscriptions ?? []); $requestedPlanId = (int) request('plan'); $activeCategoryIds = $activeSubscriptionCollection ->map(fn ($subscription) => (int) ($subscription->category_id ?: $subscription->plan?->category_id)) ->filter() ->unique() ->values(); $activePlanIds = $activeSubscriptionCollection ->map(fn ($subscription) => (int) $subscription->plan_id) ->filter() ->unique() ->values(); $hasActivePlan = $activeSubscriptionCollection->isNotEmpty(); $visiblePlans = $planCollection->reject(fn ($plan) => $activeCategoryIds->contains((int) data_get($plan, 'category_id'))); $plansByCategory = $visiblePlans->groupBy(fn ($plan) => data_get($plan, 'category.name', 'Other plans')); @endphp @include('frontend.partials.header')
@include('frontend.dashboard.provider.partials.hero', [ 'provider' => $provider, 'kicker' => 'Provider dashboard', 'title' => 'Subscription plan', 'description' => 'Review active subscriptions and explore plans from categories you have not subscribed to yet.', 'actionUrl' => route('frontend.home').'#plans', 'actionLabel' => 'View public plans', ])
@include('frontend.dashboard.provider.partials.sidebar', ['provider' => $provider, 'active' => 'subscription'])
@if ($hasActivePlan)

Active subscriptions

You can create listings under each active subscribed category.

{{ $activeSubscriptionCollection->count() }} active
@foreach ($activeSubscriptionCollection as $subscription) @php $activePlan = $subscription->plan; $activeCategory = $subscription->category ?: $activePlan?->category; $activePlanTitle = $activePlan?->title ?: ($activeCategory?->name ? $activeCategory->name . ' plan' : 'Subscription plan'); @endphp
Active plan

{{ $activeCategory?->name }} {{ $activePlanTitle }}

Valid until {{ $subscription->end_date?->format('d M Y') }}

verified
Price
Rs {{ number_format((float) $activePlan?->price, 2) }}
Duration
{{ $activePlan?->duration_months }} mo
check_circle Active from {{ $subscription->start_date?->format('d M Y') }}
check_circle {{ $activePlan?->gst_included ? 'GST included' : 'GST extra' }} at {{ number_format((float) $activePlan?->gst_percentage, 2) }}%
Add listing
@endforeach
@else
No active plan

Choose a subscription to start receiving more visibility.

Your provider account is ready. Pick a plan from the available categories below when you want to promote listings and manage leads.

workspace_premium
@endif

{{ $hasActivePlan ? 'Plans from non-subscribed categories' : 'Available subscription plans' }}

{{ $hasActivePlan ? 'Only categories without an active subscription are shown here.' : 'Compare active plans fetched from your admin subscription setup.' }}

@forelse ($plansByCategory as $categoryName => $categoryPlans) @empty
inventory_2

No plans available

Active subscription plans will appear here after they are added from admin.

@endforelse
@include('frontend.partials.footer')