@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
| #{{ $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' }}
|
|
@empty
| No vouchers found. |
@endforelse