@php $stats = is_array($stats ?? null) ? $stats : []; $totalPurchases = max( 0, (int) data_get($stats, 'total', 0) ); $paidPurchases = max( 0, (int) data_get($stats, 'paid', 0) ); $uniqueProducts = max( 0, (int) data_get($stats, 'products', 0) ); $licenseCount = max( 0, (int) data_get($stats, 'licenses', 0) ); $statCards = [ [ 'label' => __('Total Purchases'), 'value' => $totalPurchases, 'description' => trans_choice( ':count paid purchase|:count paid purchases', $paidPurchases, ['count' => number_format($paidPurchases)] ), 'icon' => 'fa-download', 'color' => 'primary', ], [ 'label' => __('Unique Products'), 'value' => $uniqueProducts, 'description' => trans_choice( ':count digital item|:count digital items', $uniqueProducts, ['count' => number_format($uniqueProducts)] ), 'icon' => 'fa-cube', 'color' => 'info', ], [ 'label' => __('Licenses'), 'value' => $licenseCount, 'description' => trans_choice( ':count active key|:count active keys', $licenseCount, ['count' => number_format($licenseCount)] ), 'icon' => 'fa-key', 'color' => 'warning', ], [ 'label' => __('Paid Purchases'), 'value' => $paidPurchases, 'description' => __('Ready to download'), 'icon' => 'fa-check-circle', 'color' => 'success', ], ]; @endphp
{{ $stat['label'] }}