$settings = $section->settings ?? []; $mode = $settings['mode'] ?? 'dynamic'; $title = $settings['title'] ?? null; $subtitle = $settings['subtitle'] ?? null; if ($mode === 'dynamic') { $totalUsers = \App\Models\User::count(); $totalProducts = \App\Modules\Product\Models\Product::published()->count(); $totalDownloads = \Illuminate\Support\Facades\DB::table('order_items')->count(); $totalVendors = \App\Modules\Vendor\Models\VendorProfile::where('status', 'approved')->count(); $formatStat = function($num) { if ($num >= 1000000) return round($num / 1000000, 1) . 'M+'; if ($num >= 1000) return round($num / 1000, 1) . 'K+'; return $num; }; $stats = [ ['label' => 'Active Users', 'value' => $formatStat($totalUsers), 'icon' => 'users', 'color' => 'from-blue-400 to-indigo-600', 'glow' => 'rgba(99, 102, 241, 0.15)'], ['label' => 'Total Sales', 'value' => $formatStat($totalDownloads), 'icon' => 'trending-up', 'color' => 'from-emerald-400 to-teal-600', 'glow' => 'rgba(16, 185, 129, 0.15)'], ['label' => 'Premium Assets', 'value' => $formatStat($totalProducts), 'icon' => 'layers', 'color' => 'from-purple-400 to-fuchsia-600', 'glow' => 'rgba(168, 85, 247, 0.15)'], ['label' => 'Elite Authors', 'value' => $formatStat($totalVendors), 'icon' => 'award', 'color' => 'from-orange-400 to-red-600', 'glow' => 'rgba(249, 115, 22, 0.15)'], ]; } else { // Check if new array-based stats exist if (isset($settings['stats']) && is_array($settings['stats'])) { $stats = $settings['stats']; } else { // Fallback to legacy keys $stats = [ ['label' => $settings['stat1_label'] ?? 'Creators', 'value' => $settings['stat1_val'] ?? '10K+', 'icon' => $settings['stat1_icon'] ?? 'users', 'color' => 'from-blue-400 to-indigo-600', 'glow' => 'rgba(99,102,241,0.15)'], ['label' => $settings['stat2_label'] ?? 'Downloads', 'value' => $settings['stat2_val'] ?? '1M+', 'icon' => $settings['stat2_icon'] ?? 'download-cloud', 'color' => 'from-emerald-400 to-teal-600', 'glow' => 'rgba(16,185,129,0.15)'], ['label' => $settings['stat3_label'] ?? 'Assets', 'value' => $settings['stat3_val'] ?? '50K+', 'icon' => $settings['stat3_icon'] ?? 'layers', 'color' => 'from-purple-400 to-fuchsia-600', 'glow' => 'rgba(168,85,247,0.15)'], ['label' => $settings['stat4_label'] ?? 'Vendors', 'value' => $settings['stat4_val'] ?? '5K+', 'icon' => $settings['stat4_icon'] ?? 'users', 'color' => 'from-orange-400 to-red-600', 'glow' => 'rgba(249,115,22,0.15)'], ]; } } $pt = $settings['padding_top'] ?? '80px'; $pb = $settings['padding_bottom'] ?? '80px'; $bg = $settings['bg_color'] ?? 'transparent'; @endphp $ptStyle = "padding-top: $pt;"; $pbStyle = "padding-bottom: $pb;"; $bgStyle = $bg !== 'transparent' ? "background-color: $bg;" : ''; @endphp
{{-- Ambient Aesthetic Glows --}}
@if($title || $subtitle)
@if($title)

{{ $title }}

@endif @if($subtitle)

{{ $subtitle }}

@endif
@endif
@foreach($stats as $index => $stat)
{{-- Interactive gradient on hover --}}
{{-- Icon (Clean, No Background, Larger) --}}
{{-- Glow behind icon --}}
{{-- Value --}}
{{ $stat['value'] }}
{{-- Label --}}
{{ $stat['label'] }}
@endforeach