@extends('profile.layout')
@section('title', __('Tarif'))
@section('content')
{{ __('Tariflər') }}
@php
$featureLabels = [
'remove_watermark' => 'Su nişanını silə bilər',
'qr_menu' => 'QR menyu',
'qr_code' => 'QR kod',
'custom_domain' => 'Öz domen (CNAME)',
'seo' => 'SEO parametrləri',
'page_limits' => 'Səhifə limitləri',
];
$hiddenFeatures = ['max_blocks', 'block_types', 'products', 'custom_theme'];
$typeLabels = ['default' => 'Bio-link', 'mini_site' => 'Mini', 'menu' => 'QR-Menyu', 'shop' => 'Mağaza'];
@endphp
{{-- Текущий тариф --}}
{{ __('Cari tarifiniz') }}
@if($currentPlan)
{{ $currentPlan->name }}
{{ number_format($currentPlan->price_azn, 2) }} ₼ / ay
@foreach($currentPlan->features ?? [] as $key => $val)
@if(in_array($key, $hiddenFeatures)) @continue @endif
@php $label = $featureLabels[$key] ?? $key; @endphp
-
@if(is_bool($val)) @if($val)@else@endif {{ $label }}
@elseif($key === 'qr_code') {{ $label }}: {{ $val === 'custom' ? 'Adi + fərdi' : 'Adi' }}
@elseif($key === 'page_limits')
@php
$active = array_filter((array) $val, fn($n) => $n > 0);
$parts = [];
foreach ($active as $t => $n) { $parts[] = ($typeLabels[$t] ?? $t) . ' ' . $n; }
@endphp
{{ $label }}: {{ $parts ? implode(', ', $parts) : '—' }}
@elseif(is_array($val)) {{ $label }}: {{ implode(', ', $val) }}
@else {{ $label }}: {{ $val }}
@endif
@endforeach
@else
{{ __('Tarifiniz yoxdur.') }}
@endif
{{-- Другие тарифы --}}
@foreach($plans as $plan)
@if($currentPlan && $plan->id === $currentPlan->id) @continue @endif
{{ $plan->name }}
{{ number_format($plan->price_azn, 2) }} ₼ / ay
@foreach($plan->features ?? [] as $key => $val)
@if(in_array($key, $hiddenFeatures)) @continue @endif
@php $label = $featureLabels[$key] ?? $key; @endphp
-
@if(is_bool($val)) @if($val)@else@endif {{ $label }}
@elseif($key === 'qr_code') {{ $label }}: {{ $val === 'custom' ? 'Adi + fərdi' : 'Adi' }}
@elseif($key === 'page_limits')
@php
$active = array_filter((array) $val, fn($n) => $n > 0);
$parts = [];
foreach ($active as $t => $n) { $parts[] = ($typeLabels[$t] ?? $t) . ' ' . $n; }
@endphp
{{ $label }}: {{ $parts ? implode(', ', $parts) : '—' }}
@elseif(is_array($val)) {{ $label }}: {{ implode(', ', $val) }}
@else {{ $label }}: {{ $val }}
@endif
@endforeach
Yüksəlt
@endforeach
@endsection