@extends('admin_base') @section('title', 'Coupons') @section('style') @endsection @section('content')

Coupons

@foreach($coupons as $key => $coupon) @php $now = \Carbon\Carbon::now(); $status = $now->between($coupon->valid_from, $coupon->valid_until) ? 'active' : ($now->lt($coupon->valid_from) ? 'upcoming' : 'expired'); @endphp @endforeach
# Code Type Value Valid Period Usage Status Actions
{{ $key + 1 }} {{ $coupon->code }} {{ ucfirst($coupon->type) }} @if($coupon->type === 'percentage') {{ $coupon->value }}% @else ৳{{ number_format($coupon->value, 2) }} @endif {{ $coupon->valid_from->format('M j, Y') }} - {{ $coupon->valid_until->format('M j, Y') }} {{ $coupon->usage_count }} / {{ $coupon->usage_limit ?: '∞' }} @if($coupon->usage_limit && $coupon->usage_count >= $coupon->usage_limit)
Limit reached @endif
{{ ucfirst($status) }}
@endsection @section('script') @endsection