@extends('admin.layouts.app') @php $pageTitle = $pageTitle ?? 'All Transactions'; $userDetailsUrl = function ($id) { if(\Illuminate\Support\Facades\Route::has('admin.users.detail')) return route('admin.users.detail', $id); if(\Illuminate\Support\Facades\Route::has('admin.users.show')) return route('admin.users.show', $id); return '#'; }; @endphp @section('panel') @push('style') @endpush
@lang('All Transactions')
@lang('Total'): {{ $transactions->total() }}
@if(session('ok'))
{{ session('ok') }}
@endif @if(session('error'))
{{ session('error') }}
@endif
@forelse($transactions as $t) @php $isIn = ($t->flow ?? '') === 'in'; $u = $t->user; $userId = $t->user_id ?? null; $userName = $u?->name ?? 'N/A'; $userEmail = $u?->email ?? '-'; $uUrl = $userId ? $userDetailsUrl($userId) : '#'; $ref = $t->reference ?? '-'; $meta = $t->meta ?? []; if(is_string($meta)){ $decoded = json_decode($meta, true); $meta = is_array($decoded) ? $decoded : []; } @endphp @empty @endforelse
@lang('ID') @lang('TRX') @lang('User') @lang('Type') @lang('Flow') @lang('Amount') @lang('Date') @lang('Action')
#{{ $t->id }} {{ $t->trx_id }} {{ $userName }} @if($userId)
#{{ $userId }}
@endif
{{ $t->type }} @if($isIn) IN @else OUT @endif {{ number_format((float)$t->amount, 2) }} {{ optional($t->created_at)->format('d M Y, h:i A') }}
@lang('No transactions found')
@if($transactions->hasPages()) @endif
@endsection @push('breadcrumb-plugins') @endpush @push('script') @endpush