@section('page-title', 'QR Codes')
{{-- Success Message --}} @if (session()->has('message'))

{{ session('message') }}

@endif {{-- Info Message --}}

Table Features:

  • Date Used: Shows exactly when a QR code was verified/used
  • Attempts: Tracks verification attempts (color-coded: blue=1-2, yellow=3-4, red=5+)
  • Filters: Use Date, Status, Lucky, and Attempts filters for faster queries
  • Performance: All columns indexed for optimal performance with millions of records
{{-- Top Controls --}}
@if($filterDate || $filterStatus || $filterLucky || $filterAttempts || $filterProduct || $search) @endif
{{-- Table Card --}}
{{-- Table Controls --}}
{{-- Table --}}
@forelse($codes as $code) @empty @endforelse
# @if($sortField === 'id') {{ $sortDirection === 'asc' ? '↑' : '↓' }} @endif
Serial @if($sortField === 'serial') {{ $sortDirection === 'asc' ? '↑' : '↓' }} @endif
PINCODE @if($sortField === 'qr_pin') {{ $sortDirection === 'asc' ? '↑' : '↓' }} @endif
Date Added @if($sortField === 'created_at') {{ $sortDirection === 'asc' ? '↑' : '↓' }} @endif
Status @if($sortField === 'status') {{ $sortDirection === 'asc' ? '↑' : '↓' }} @endif
Date Used @if($sortField === 'used_at') {{ $sortDirection === 'asc' ? '↑' : '↓' }} @endif
Attempts @if($sortField === 'attempts') {{ $sortDirection === 'asc' ? '↑' : '↓' }} @endif
Assign
Exported @if($sortField === 'last_exported_at') {{ $sortDirection === 'asc' ? '↑' : '↓' }} @endif
Product
Is Lucky? @if($sortField === 'is_lucky') {{ $sortDirection === 'asc' ? '↑' : '↓' }} @endif
Action
{{ $code->id }} {{ $code->serial }} {{ $code->qr_pin }}
{{ $code->created_at->format('Y-m-d') }} {{ $code->created_at->format('H:i:s') }}
@if($code->status === 'used') USED @else UNUSED @endif @if($code->used_at)
{{ $code->used_at->format('Y-m-d') }} {{ $code->used_at->format('H:i:s') }}
@else - @endif
@if($code->attempts > 0) {{ $code->attempts }} @else 0 @endif @if($code->agent) {{ $code->agent->seller_id }} @else - @endif @if($code->last_exported_at) @else - @endif @if($code->product) {{ $code->product->name }} @else Unassigned @endif {{ $code->is_lucky ? 'YES' : 'NO' }}
No QR codes found.
{{-- Pagination --}}
{{ $codes->links() }}