@php $section_content = (array) ($section_content ?? []); $plans = (array) ($section_content['plans'] ?? []); $contactUrl = route('site.contactUs'); @endphp @if(count($plans) > 0)
@foreach($plans as $plan) @php $color = $plan['color'] ?? 'gold'; $modalId = 'subscription-plan-' . ($plan['id'] ?? $loop->index); $planTitle = $plan['title'] ?? ''; $durationLabel = $plan['duration_label'] ?? ''; $amountFormatted = $plan['amount_formatted'] ?? ''; $features = (array) ($plan['features'] ?? []); $modalFeatures = array_values(array_filter($features, fn ($f) => is_array($f) && trim((string) ($f['title'] ?? '')) !== '')); $featureCount = count($modalFeatures); $pageLink = ! empty($plan['button_link']) ? $plan['button_link'] : $contactUrl; $cardFeatures = array_slice($modalFeatures, 0, 6); $planButtons = array_values(array_filter((array) ($plan['buttons'] ?? []), fn ($btn) => is_array($btn) && !empty($btn['text']) && !empty($btn['link']))); $planButtonsCount = count($planButtons); if (empty($planButtons)) { $planButtons = [ ['text' => 'تماس جهت خرید', 'link' => $contactUrl, 'class' => $color . '-btn'], ['text' => 'ارجاع به صفحه', 'link' => $pageLink, 'class' => 'btn-dark-gray'], ]; $planButtonsCount = count($planButtons); } @endphp @endforeach
@foreach($plans as $plan) @php $color = $plan['color'] ?? 'gold'; $modalId = 'subscription-plan-' . ($plan['id'] ?? $loop->index); $planTitle = $plan['title'] ?? ''; $durationLabel = $plan['duration_label'] ?? ''; $amountFormatted = $plan['amount_formatted'] ?? ''; $features = (array) ($plan['features'] ?? []); $modalFeatures = array_values(array_filter($features, fn ($f) => is_array($f) && trim((string) ($f['title'] ?? '')) !== '')); $cardFeatures = array_slice($modalFeatures, 0, 6); $pageLink = ! empty($plan['button_link']) ? $plan['button_link'] : $contactUrl; $planButtons = array_values(array_filter((array) ($plan['buttons'] ?? []), fn ($btn) => is_array($btn) && !empty($btn['text']) && !empty($btn['link']))); $planButtonsCount = count($planButtons); if (empty($planButtons)) { $planButtons = [ ['text' => 'تماس جهت خرید', 'link' => $contactUrl, 'class' => $color . '-btn'], ['text' => 'ارجاع به صفحه', 'link' => $pageLink, 'class' => 'btn-dark-gray'], ]; $planButtonsCount = count($planButtons); } @endphp
اشتراک {{ $planTitle }}
پیشنهادی
{{ $durationLabel }} {{ $amountFormatted }} تومان @if(count($cardFeatures) > 0)
    @foreach($cardFeatures as $feature) @php $ft = trim((string) ($feature['title'] ?? '')); @endphp @if($ft !== '')
  • @if(($feature['badge_color'] ?? 'green') === 'red') @else @endif {{ $ft }}
  • @endif @endforeach
@endif
@foreach($planButtons as $button) @endforeach
@endforeach
@endif