@extends('layouts.admin') @section('title', 'Rewards & Referrals') @section('content') @php $labels = [ 'rewards_signup_points' => 'Friend creates an account', 'rewards_referral_tour_points' => 'Friend books a tour package', 'rewards_referral_ship_points' => 'Friend books a ship / cruise', 'rewards_referral_flight_points' => 'Friend books an air ticket', 'rewards_referral_resort_points' => 'Friend books a resort', ]; $discountLabel = fn ($coupon) => $coupon->discount_type === 'percent' ? rtrim(rtrim(number_format((float) $coupon->discount_value, 2), '0'), '.') . '% off' : 'BDT ' . number_format((float) $coupon->discount_value) . ' off'; @endphp @unless ($enabled)
| Coupon | For | Discount | Min. spend | Valid | Cost | Status | Action |
|---|---|---|---|---|---|---|---|
| {{ $coupon->title }} | {{ $categories[$coupon->category] ?? $coupon->category }} | {{ $discountLabel($coupon) }}@if ($coupon->max_discount) max BDT {{ number_format((float) $coupon->max_discount) }}@endif |
BDT {{ number_format((float) $coupon->min_spend) }} | {{ $coupon->valid_days }} days | {{ number_format($coupon->points_cost) }} pts | {{ $coupon->is_active ? 'On sale' : 'Hidden' }} |
|
| No coupons yet. Add the first one below. | |||||||
| When | Customer | What | Friend | Points |
|---|---|---|---|---|
| {{ $tx->created_at?->format('d M Y H:i') }} | {{ $tx->customer?->full_name }} | {{ $tx->description }} ยท {{ str_replace('_', ' ', $tx->kind) }} | {{ $tx->relatedCustomer?->full_name ?: '-' }} | {{ $tx->points > 0 ? '+' : '' }}{{ number_format($tx->points) }} |
| Nothing earned or spent yet. | ||||