{{ __('Coupon Codes') }} - {{ $user->name }}

Back to Users
@if(session('success')) @endif @if(session('error')) @endif
{{ strtoupper(substr($user->name, 0, 1)) }}

{{ $user->name }}

{{ $user->email }}

{{ $user->mobile_no ?? 'No mobile' }}

Generate New Coupon Code

@csrf

Number of days the subscription will be valid after coupon use

Coupon Codes ({{ $coupons->count() }})

@if($coupons->count() > 0)
@foreach($coupons as $index => $coupon) @php $today = \Carbon\Carbon::today(); $isExpired = $today->gt($coupon->valid_to); $statusClass = ''; $statusText = ''; if ($coupon->is_used) { $statusClass = 'bg-gray-100 text-gray-800'; $statusText = 'Used'; } elseif ($isExpired) { $statusClass = 'bg-red-100 text-red-800'; $statusText = 'Expired'; } else { $statusClass = 'bg-green-100 text-green-800'; $statusText = 'Active'; } @endphp @endforeach
S.No Coupon Code Subscription Days Valid From Valid To Status Used At Actions
{{ $index + 1 }}
{{ $coupon->code }}
{{ $coupon->validity_days }} days {{ $coupon->valid_from->format('d M Y') }} {{ $coupon->valid_to->format('d M Y') }} {{ $statusText }} {{ $coupon->used_at ? $coupon->used_at->timezone('Asia/Kolkata')->format('d M Y H:i') : '-' }} @if(!$coupon->is_used)
@csrf @method('DELETE')
@endif
@else

No coupon codes generated yet

@endif