@extends('frontend::layouts.master') @section('content')

{{ __('frontend.subscription_plan') }}

@if(!empty($activeSubscriptions))
{{ $activeSubscriptions->name }}

{{__('frontend.expiring_on')}} {{ \Carbon\Carbon::parse($activeSubscriptions->end_date)->format('d F, Y') }}

@else
{{__('frontend.no_active_plan')}}

{{__('frontend.not_active_subscription')}}

@endif
@if(!empty($activeSubscriptions)) @else @endif
@foreach($plans as $plan)

{{ $plan->name }}

@if($plan->discount == 1)
{{$plan->discount_percentage}} % off
@endif

@if($plan->discount == 1) {{ Currency::format($plan->price) }}/ {{ Currency::format($plan->total_price) }} @else {{ Currency::format($plan->price) }} @endif / {{ $plan->duration_value }} {{ $plan->duration }}

{!! $plan->description !!}

    @foreach ($plan->planLimitation as $limitation) @php // Set the default icon class for disabled state $iconClass = 'ph-x-circle text-danger'; // Determine icon class based on specific conditions if ($limitation->limitation_value) { $iconClass = 'ph-check-circle text-success'; // Show check for enabled limitations } elseif ($limitation->limitation_slug === 'device-limit' && $limitation->limit == 0) { $iconClass = 'ph-check-circle text-success'; // Show check for 1 mobile device } elseif ($limitation->limitation_slug === 'profile-limit' && $limitation->limit == 0) { $iconClass = 'ph-check-circle text-success'; // Show check for profile limit } @endphp
  • @switch($limitation->limitation_slug) @case('video-cast') Video Casting is {{ $limitation->limitation_value ? 'enabled' : 'not available' }}. @break @case('ads') Ads will {{ $limitation->limitation_value ? 'be shown' : 'not be shown' }}. @break @case('device-limit') You can use {{ $limitation->limit == 0 ? '**only 1 mobile device**' : "up to {$limitation->limit} device(s)" }} simultaneously. @break @case('download-status') Download resolutions: @php $availableQualities = []; $notAvailableQualities = []; @endphp @foreach (json_decode($limitation->limit, true) as $quality => $available) @if($available == 1) @php $availableQualities[] = strtoupper($quality); @endphp @else @php $notAvailableQualities[] = strtoupper($quality); @endphp @endif @endforeach
      @if (!empty($availableQualities))
    • {{ implode('/', $availableQualities) }}
    • @endif @if (!empty($notAvailableQualities))
    • {{ implode('/', $notAvailableQualities) }}
    • @endif
    @break @case('supported-device-type') @php $supportedDevices = json_decode($limitation->limit, true); $supportedDevicesList = []; @endphp @foreach ($supportedDevices as $device => $supported) @if ($supported == 1) @php $supportedDevicesList[] = strtolower($device); // Convert device names to lowercase @endphp @endif @endforeach @if (!empty($supportedDevicesList))
    Supported on: {{ implode(', ', $supportedDevicesList) }}.
    @else
    Only Mobile is supported for this plan.
    @endif @break @case('profile-limit') You can create up to {{ $limitation->limit == 0 ? 1 : $limitation->limit }} profiles on this plan for different users. @break @default {{ ucwords(str_replace('-', ' ', $limitation->limitation_slug)) }}: {{ $limitation->limitation_value ? 'Enabled' : 'Disabled' }} @endswitch
  • @endforeach
@endforeach
@endsection