@section('page_title', 'Transactions') @section('content') {{-- Filter Bar --}}
🔍
@if (request()->hasAny(['search', 'status'])) Clear @endif ⬇ Export CSV
{{-- Summary Stats --}}
@php $totalTx = $transactions->total(); $sumVotes = $transactions->getCollection()->where('status','success')->sum('vote_count'); $sumAmt = $transactions->getCollection()->where('status','success')->sum('amount_paid'); @endphp
{{ number_format($totalTx) }}
Total Transactions
{{ number_format($sumVotes) }}
Votes (Paid)
₦{{ number_format($sumAmt) }}
Revenue (Paid)
{{-- Transactions Table --}}

All Transactions

@forelse ($transactions as $t) @empty @endforelse
Reference Voter Nominee Votes Amount Status Date
{{ $t->paystack_reference }}
{{ $t->voter_name }}
{{ $t->voter_email }}
{{ $t->nominee->farm_name }} {{ number_format($t->vote_count) }} ₦{{ number_format($t->amount_paid) }} {{ $t->paid_at?->format('d M Y H:i') ?? $t->created_at->format('d M Y H:i') }} @if ($t->status !== 'success')
@csrf
@endif
💳

No transactions found

Transactions will appear here once voting begins

@if ($transactions->hasPages())
{{ $transactions->appends(request()->query())->links() }}
@endif
@endsection