@extends('layouts.subscriptions') @push('style') @endpush @section('content') @php $periodStart = $subscription->effective_starts_at; $periodEnd = $subscription->effective_ends_at; $isExpired = (bool) $subscription->is_expired; $maxSlots = max((int) $subscription->remaining_slots, 1); $initialSlots = min(max((int) old('slots_taken', 1), 1), $maxSlots); $monthlyPrice = (float) $subscription->price_per_slot * $initialSlots; $platformFee = 0.64 * $initialSlots; $totalPayable = $monthlyPrice + $platformFee; $strikedPrice = (float) $subscription->total_price; $availableBalance = (float) (auth()->user()?->balance ?? 0); $hasSufficientBalance = $availableBalance >= $totalPayable; $serviceLogo = marketplaceImageUrl($subscription->service?->logo ?: $subscription->service?->category?->image_url); $isYouTube = str_contains(strtolower($subscription->service?->name ?? ''), 'youtube'); $serviceDescription = trim((string) ($subscription->service?->description ?? '')); if ($serviceDescription === '') { $serviceDescription = trim((string) (\App\Models\Service::query() ->where('name', $subscription->service?->name) ->whereNotNull('description') ->where('description', '!=', '') ->value('description') ?? '')); } if ($serviceDescription === '') { $serviceDescription = trim((string) (\App\Models\Service::query() ->where('category_id', $subscription->service?->category_id) ->where(function ($q) use ($subscription) { $name = strtolower(trim((string) ($subscription->service?->name ?? ''))); $q->whereRaw('LOWER(name) = ?', [$name]); }) ->whereNotNull('description') ->where('description', '!=', '') ->value('description') ?? '')); } $planFeatures = trim((string) ($subscription->servicePlan?->features ?? '')); @endphp

{{ $subscription->service?->name ?? 'Subscription' }} {{ $subscription->servicePlan?->name ?? ($subscription->title ?? '') }}

Hosted by {{ $subscription->owner?->name ?? 'Host' }} • {{ $subscription->remaining_slots }} seat(s) available
@if($errors->any())
{{ $errors->first() }}
@endif @if($serviceDescription !== '' || $planFeatures !== '')
Package Description & Instructions
@if($serviceDescription !== '')
{!! nl2br(e($serviceDescription)) !!}
@endif @if($planFeatures !== '')
Plan Features & Inclusions: {!! nl2br(e($planFeatures)) !!}
@endif
@endif
Monthly
@if($isYouTube)
YouTube Package Request: Please enter your email or username below. Your request will be sent directly to the package owner's email so they can invite you to their YouTube Family group.
@else
{{ $subscription->credentials_shared ? 'Service access is shared by credentials. After payment, details are available in your subscription panel.' : 'Service access is shared through invitation workflow after the owner approves your request.' }}
@endif @if($isExpired)
This package is expired: The 30-day subscription period has ended (ended on {{ $periodEnd->format('M.d, Y') }}). New members cannot join this listing.
@endif
@if($isYouTube) @csrf @endif
Subscription period (30 days): @if($isExpired) Expired @endif
{{ $periodStart->format('M.d,Y') }}
to
{{ $periodEnd->format('M.d,Y') }}
Number of seats
x {{ $initialSlots }}
Subscription price :
${{ number_format($strikedPrice, 2) }} / month
{{ number_format($monthlyPrice, 2) }} $ / month
@if($isYouTube)
Please enter your Google/YouTube email or username so the owner can send you the family invitation via email.
@endif
@if($isExpired) @elseif($isYouTube) @else @endif

You will not be able to join and be charged for a subscription until the owner agrees.

If the user accepts your request, cancellation right may not apply as per policy.

@endsection