@extends('layouts.admin') @section('page-title', 'Coupons') @section('content')
You have total {{ $coupons->total() }} coupons
| # | Code | Type | Value | Min Purchase | Usage | Valid Until | Status | Options |
|---|---|---|---|---|---|---|---|---|
| {{ $loop->iteration + ($coupons->currentPage() - 1) * $coupons->perPage() }} | {{ $coupon->code }} | @php $typeConfig = match($coupon->type) { 'percentage' => ['label' => 'Percentage', 'bg' => 'bg-blue-50', 'text' => 'text-blue-700', 'icon' => '%'], 'fixed' => ['label' => 'Fixed', 'bg' => 'bg-emerald-50', 'text' => 'text-emerald-700', 'icon' => '$'], 'free_shipping' => ['label' => 'Free Shipping', 'bg' => 'bg-purple-50', 'text' => 'text-purple-700', 'icon' => '🚚'], default => ['label' => $coupon->type, 'bg' => 'bg-gray-50', 'text' => 'text-gray-700', 'icon' => ''], }; @endphp {{ $typeConfig['label'] }} | @if($coupon->type === 'free_shipping') Free @elseif($coupon->type === 'percentage') {{ $coupon->value }}% @else ${{ number_format($coupon->value, 2) }} @endif | {{ $coupon->min_purchase ? '$'.number_format($coupon->min_purchase, 2) : '-' }} |
@php
$usagePercent = $coupon->usage_limit > 0 ? ($coupon->used_count / $coupon->usage_limit) * 100 : 0;
@endphp
{{ $coupon->used_count }}/{{ $coupon->usage_limit ?? '∞' }}
|
{{ $coupon->valid_until?->format('M d, Y') ?? 'No expiry' }} | {{ $coupon->is_active ? 'Active' : 'Inactive' }} | |
|
No coupons found Create your first coupon to get started |
||||||||