@extends('api_panel.layouts.app') @section('title', t('apipanel-store-title')) @section('content') @php use App\Services\ApiPlatform\ProductCatalog; $endpointsTabUrl = route('apipanel.store', ['tab' => 'endpoints']); @endphp

{{ t('apipanel-store-title') }}

{{ t('apipanel-store-subtitle') }}

{{-- ─── Ürünler ─── --}}

{{ ProductCatalog::text('apipanel-products-title', 'Ürünler', 'Products') }}

{{ ProductCatalog::text('apipanel-products-subtitle', 'Her ürün, plan kotası · kredi veya endpoint paketi ile kullanılabilir.', 'Every product can be used with plan quota, credits or an endpoint pack.') }}
@foreach($products as $product) {{-- MCP satın alınabilir bir kalem değil: tek başına tam genişlikte durur. --}}

{{ $product['name'] }}

{{ $product['tagline'] }}

@if($product['is_mcp']) @if($mcpHasAccess) {{ ProductCatalog::text('apipanel-product-mcp-badge-active', 'Planınızda dahil', 'Included in your plan') }} @else {{ ProductCatalog::text('apipanel-product-mcp-badge', 'MCP erişimi olan bir plan gerekir', 'Requires a plan with MCP access') }} @endif @else {{ $product['sku_count'] }} {{ ProductCatalog::text('apipanel-products-endpoint-unit', 'endpoint', 'endpoints') }} @if($product['has_offers']) {{ $product['offer_count'] }} {{ ProductCatalog::text('apipanel-products-offer-unit', 'paket', 'packs') }} @endif @endif
@endforeach
{{ t('apipanel-store-tab-plans') }} {{ t('apipanel-store-tab-credits') }} {{ t('apipanel-store-tab-endpoints') }}
{{-- ─── Planlar ─── --}}
@if($plans->isEmpty())

{{ t('apipanel-store-empty') }}

@else
@foreach($plans as $plan)

{{ t((string) $plan->name_key) }}

@if($plan->description_key)

{{ t((string) $plan->description_key) }}

@endif
{{ number_format((float) $plan->monthly_price, 2, ',', '.') }} ₺ / {{ t('apipanel-month') }}
  • {{ $plan->isUnlimited() ? t('apipanel-stat-unlimited') : number_format((int) $plan->monthly_request_quota) }} {{ t('apipanel-usage-requests') }}
  • {{ number_format((int) $plan->rate_limit_per_minute) }} {{ t('apipanel-plan-rate-limit') }}
  • {{ (int) $plan->max_keys }} {{ t('apipanel-plan-max-keys') }}
@csrf
@endforeach
@endif
{{-- ─── Kredi paketleri ─── --}}
@if($creditPacks->isEmpty())

{{ t('apipanel-store-empty') }}

@else
@foreach($creditPacks as $pack)

{{ t((string) $pack->name_key) }}

{{ number_format((float) $pack->price, 2, ',', '.') }} ₺

{{ number_format((int) $pack->credits) }} {{ t('apipanel-credit-unit') }}

@csrf
@endforeach
@endif
{{-- ─── Endpoint paketleri (ürün başlıkları altında) ─── --}}
@if(empty($offerProducts))

{{ t('apipanel-store-empty') }}

@else @foreach($offerProducts as $bucket)

{{ $bucket['name'] }} {{ count($bucket['skus']) }} {{ ProductCatalog::text('apipanel-products-endpoint-unit', 'endpoint', 'endpoints') }}

@foreach($bucket['skus'] as $group)

{{ $group['name'] }}

{{ $group['sku'] }} @unless($group['sku'] === \App\Services\ApiPlatform\ApiMeteringService::MCP_ACCESS_SKU)

{{ str_replace(':credits', $group['credit_cost'], t('apipanel-credit-note')) }}

@endunless @foreach($group['offers'] as $offer)
@csrf
{{ $offer->isMonthly() ? t('apipanel-offer-monthly') : t('apipanel-offer-onetime') }} @unless($group['sku'] === \App\Services\ApiPlatform\ApiMeteringService::MCP_ACCESS_SKU) {{ number_format((int) $offer->requests) }} {{ t('apipanel-usage-requests') }} @endunless {{ number_format((float) $offer->price, 2, ',', '.') }} ₺
@endforeach
@endforeach
@endforeach @endif
@endsection