@extends('layouts.admin') @section('content')
Voucher Management
@forelse($vouchers as $voucher) @php $now = now(); $startDate = \Carbon\Carbon::parse($voucher->start_date); $expirationDate = \Carbon\Carbon::parse($voucher->expiration_date); if ($now->lt($startDate)) { $status = 'new'; $statusText = 'Upcoming'; } elseif ($now->gt($expirationDate)) { $status = 'expired'; $statusText = 'Expired'; } else { $status = 'in_progress'; $statusText = 'In Progress'; } @endphp @empty @endforelse
Voucher ID Voucher Name Voucher Code Start Date Expiration Date Min. Order Value Max. Discount Voucher Value Voucher Type Action
#{{ $voucher->id }} {{ $voucher->name }} {{ $voucher->code }} {{ $startDate->format('d.m.Y') }} {{ $expirationDate->format('d.m.Y') }} {{ number_format($voucher->min_order_value, 2, ',', '.') }} € {{ number_format($voucher->max_discount, 2, ',', '.') }} € @if ($voucher->type == '1') {{ number_format($voucher->voucher_value, 2, ',', '.') }} € @else {{ rtrim(rtrim(number_format($voucher->voucher_value, 2, ',', '.'), '0'), ',') }}% @endif {{ $voucher->type == '1' ? 'Fixed' : 'Percentage' }}
No vouchers found.
@push('script') @endpush @endsection