@extends('admin.layout') @section('content') @if(session('success'))

{{ session('success') }}

@endif {{-- Filter Form --}}

Filters

@if(request('type') || request('claimed') !== null || request('holiday_id')) @endif
{{-- Results Count --}}

Showing {{ $vouchers->count() }} voucher(s)

{{-- Vouchers Table --}}
@forelse ($vouchers as $voucher) @empty @endforelse
Code Type Claimed By Holiday Claimed At Actions
{{ $voucher->code }}
{{ ucfirst($voucher->type) }} @if($voucher->claimed_by)
{{ strtoupper(substr($voucher->user ? ($voucher->user->first_name ?? $voucher->user->email) : 'U', 0, 1)) }}
{{ $voucher->user ? $voucher->user->name : 'User #' . $voucher->claimed_by }}
@else Not claimed @endif
@if($voucher->holiday)
@if($voucher->holiday->emoji) {{ $voucher->holiday->emoji }} @endif
{{ $voucher->holiday->title }} {{ \Carbon\Carbon::parse($voucher->holiday->start_date)->format('M d, Y') }}
@else - @endif
{{ $voucher->claimed_at ? $voucher->claimed_at->format('M d, Y') : '-' }} @if($voucher->claimed_at) {{ $voucher->claimed_at->format('H:i') }} @endif
@csrf @method('DELETE')

No vouchers found

Import vouchers or create one manually to get started

{{-- Pagination --}} @if($vouchers->hasPages())
{{ $vouchers->links() }}
@endif {{-- Hidden Form for Bulk Delete --}} @endsection