Promo Codes (Platform-wide)
{{-- Filters --}}
{{-- Table --}}
@forelse($codes['data'] ?? [] as $code) @php $now = now(); if (!($code['is_active'] ?? false)) { $cs = ['label'=>'Inactive','cls'=>'bg-gray-800 text-gray-400']; } elseif (($code['valid_from'] ?? null) && $now->lt(\Carbon\Carbon::parse($code['valid_from']))) { $cs = ['label'=>'Scheduled','cls'=>'bg-blue-900/40 text-blue-400']; } elseif (($code['valid_until'] ?? null) && $now->gt(\Carbon\Carbon::parse($code['valid_until']))) { $cs = ['label'=>'Expired','cls'=>'bg-red-900/40 text-red-400']; } elseif (($code['usage_limit'] ?? null) && ($code['used_count'] ?? 0) >= $code['usage_limit']) { $cs = ['label'=>'Used up','cls'=>'bg-yellow-900/40 text-yellow-400']; } else { $cs = ['label'=>'Active','cls'=>'bg-green-900/40 text-green-400']; } @endphp @empty @endforelse
Code Organization Discount Usage Validity Status
{{ $code['code'] }} @if($code['description'] ?? null)

{{ $code['description'] }}

@endif
{{ $code['organization']['name'] ?? '—' }} @if($code['organization']['subdomain'] ?? null) {{ $code['organization']['subdomain'] }} @endif {{ ($code['discount_type'] ?? '') === 'percent' ? ($code['discount_value'] ?? 0) . '%' : '₹' . ($code['discount_value'] ?? 0) }} @if(($code['max_discount'] ?? null) && ($code['discount_type'] ?? '') === 'percent') (max ₹{{ $code['max_discount'] }}) @endif {{ $code['used_count'] ?? 0 }} / {{ $code['usage_limit'] ?? '∞' }} @if(($code['valid_from'] ?? null) || ($code['valid_until'] ?? null)) {{ $code['valid_from'] ?? '–' }} → {{ $code['valid_until'] ?? '∞' }} @else No expiry @endif {{ $cs['label'] }}
No promo codes found.
{{-- Pagination --}} @if(!empty($codes['links']))
@foreach($codes['links'] as $link) @if($link['url']) {!! $link['label'] !!} @else {!! $link['label'] !!} @endif @endforeach
@endif