@php $symbol = siteCurrency('symbol'); $colorMap = [ 'deposit' => 'success', 'withdraw' => 'danger', 'payment' => 'primary', 'reward' => 'warning', ]; $iconMap = [ 'deposit' => 'fa-arrow-down', 'withdraw' => 'fa-arrow-up', 'payment' => 'fa-credit-card', 'reward' => 'fa-gift', ]; $series = $chartData['series'] ?? []; $categories = $chartData['dates'] ?? []; $stats = collect($series)->map(function ($item) use ($colorMap, $iconMap) { $type = strtolower($item['name']); $total = collect($item['data'])->sum(); return [ 'type' => $type, 'label' => __(ucfirst($type)) . 's', 'amount' => $total, 'color' => $colorMap[$type] ?? 'secondary', 'icon' => $iconMap[$type] ?? 'fa-chart-line', 'tooltip' => __('Total') . ' ' . __(ucfirst($type)) . 's', ]; }); @endphp
@foreach($stats as $stat)
@endforeach