@extends('frontend.main_master') @section('body-class', 'panel-page') @section('no-header', true) @section('title', t('subscribe') . ' - ' . t('site-title')) @push('styles') @endpush @section('content')
{{-- Toasts --}}
@if (session('success')) @endif @if (session('error')) @endif
{{-- Sepetim (sağ üst) --}} {{-- Hero --}}

{{ t('select-plan') }}

@php $isEnLocale = str_starts_with(strtolower((string) config('app.locale', env('APP_LOCALE', 'tr'))), 'en'); @endphp {{-- Abonelik Türü Sekmeleri --}}
@if ($isSubscriber)

{{ t('subscription.already_active') }}

@else {{-- Plan Cards (Tam Abonelik) --}}
@foreach ($plans as $plan) @php $isEn = str_starts_with(strtolower((string) config('app.locale', env('APP_LOCALE', 'tr'))), 'en'); $package = $plan['package'] ?? null; $isPop = $plan['key'] === $featuredFullPlanKey; $hasDsc = $plan['price_normal'] > $plan['price']; $mEq = $plan['months'] > 1 ? round($plan['price'] / $plan['months']) : null; $periodText = $plan['months'] === 1 ? ($isEn ? 'month' : 'ay') : ($plan['months'] . ' ' . ($isEn ? 'months' : 'ay')); $desc = match (true) { $plan['months'] === 1 => t('beginner-plan'), $plan['months'] === 6 => t('most-popular-plan'), default => t('pro-plan'), }; $colClass = $isPop ? 'plan-col--featured' : 'plan-col--normal'; @endphp
@endforeach
@endif
{{-- /#pane-plan-full --}}
@if ($isSubscriber)

{{ t('subscription.already_active') }}

@else {{-- Plan Cards (Tokensiz Abonelik) --}}
@foreach ($tokenlessPlans as $plan) @php $isEn = $isEnLocale; $isPop = $plan['key'] === $featuredTokenlessPlanKey; $hasDsc = $plan['price_normal'] > $plan['price']; $mEq = $plan['months'] > 1 ? round($plan['price'] / $plan['months']) : null; $colClass = $isPop ? 'plan-col--featured' : 'plan-col--normal'; @endphp
@endforeach
@endif
{{-- /#pane-plan-tokenless --}}
{{-- Puan Paketleri --}} @if (($userCredits['chat_words'] ?? 0) > 0)

{{ t('current-balance') }}: {{ number_format($userCredits['chat_words']) }}

@endif
@csrf
@foreach ($packages as $package) @php $baseDiscounted = $package->price_discounted; $subscriberPrice = $isSubscriber && !is_null($package->price_discounted_subscriber) ? $package->price_discounted_subscriber : null; $effectivePrice = $subscriberPrice ?? $baseDiscounted; $isFeatured = $package->id === $featuredPackageId; $hasDiscount = $package->price_normal > $effectivePrice; @endphp
@endforeach
{{-- Action bar --}}
{{ t('select-package-to-cart') }}
{{ t('package-cart-description') }}
{{ t('go-to-cart') }}
{{-- /#pane-plan-points --}} {{-- Yorum Paketleri (Single Token Products) --}}
@if (!empty($commentTokenProducts))
{{ $isEnLocale ? 'Reading Packages' : 'Yorum Paketleri' }}

{{ $isEnLocale ? 'Get the reading you want' : 'İstediğiniz yorumu alın' }}

@foreach (['natal' => t('natal-comment'), 'relationship' => t('relationship-comment'), 'annual' => t('annual-comment')] as $commentType => $commentLabel) @php $prod = $commentTokenProducts[$commentType] ?? null; if (!$prod) { continue; } @endphp
{{ $commentLabel }}
{{ number_format($prod['price'], 0, ',', '.') }} {{ t('currency') }}
@csrf
@endforeach
@endif
{{-- /#pane-plan-comments --}}
{{-- /.tab-content --}}
@endsection