@php $headerOption = [ 'title' => $module, 'header_buttons' => [ ($permission['create'] ? ''. \Config::get('settings.icon_add') .' Add New' : '') ], 'filters' => isset($filters) ? $filters : [], 'data' => isset($data) ? $data : [] ]; @endphp @extends('admin.layouts.layout', $headerOption) @push('page_css') @endpush @section('content')
Total Raised

{!! \App\Helpers\Helper::price($totalRaised ?? 0) !!} @if(($totalRaisedPercentageChange ?? 0) >= 0) @else @endif

@php $percentageText = ($totalRaisedPercentageChange ?? 0) >= 0 ? '+' : ''; $percentageText .= number_format($totalRaisedPercentageChange ?? 0, 1) . '%'; @endphp {{ $percentageText }} From previous period
Active Campaigns

{{ $activeCampaigns ?? 0 }}

Currently active
NFT Sold

{{ number_format($nftsSold ?? 0) }}

Total NFTs sold
Total Transfered

{!! \App\Helpers\Helper::price($pendingWithdrawals ?? 0) !!}

@php $withdrawalText = ($pendingWithdrawals ?? 0) > 0 ? (\App\Helpers\Helper::price(number_format($totalRaised - $pendingWithdrawals ?? 0)) . ' Transfer Pending') : 'No Transfer Pending'; @endphp {{ $withdrawalText }}
@if (count($data) != 0) @foreach ($data as $key => $campaign) @php // Calculate progress percentage $progress = $campaign->fund_target > 0 ? ($campaign->fund_raised / $campaign->fund_target) * 100 : 0; $progress = min(100, max(0, $progress)); // Calculate total NFTs minted from all tiers $totalNftsMinted = 0; if ($campaign->nftTiers) { $totalNftsMinted = $campaign->nftTiers->sum('nft_quantity'); } // Status badge styling $statusBadgeClass = 'badge-soft-success'; $statusText = $campaign->status_text; $badgeBg = '#D4FCE5'; $badgeColor = '#1BAA58'; if ($campaign->status == 0) { $statusBadgeClass = 'badge-soft-warning'; $badgeBg = '#FFF7E0'; $badgeColor = '#D28A00'; } elseif ($campaign->status == 2) { $statusBadgeClass = 'badge-soft-info'; $badgeBg = '#E0F7FA'; $badgeColor = '#0097A7'; } // Icon and color based on campaign $iconColors = [ ['icon' => 'bi-heart', 'color' => 'text-danger', 'bg' => '#FFE4E4', 'progress' => '#FF5D5D'], ['icon' => 'bi-lightbulb', 'color' => 'text-warning', 'bg' => '#FFF7E0', 'progress' => '#FFD600'], ['icon' => 'bi-droplet', 'color' => 'text-info', 'bg' => '#E0F7FA', 'progress' => '#00BCD4'], ['icon' => 'bi-tree', 'color' => 'text-success', 'bg' => '#D4FCE5', 'progress' => '#23C46D'], ['icon' => 'bi-award', 'color' => 'text-primary', 'bg' => '#E3F2FD', 'progress' => '#1976D2'], ['icon' => 'bi-trophy', 'color' => 'text-warning', 'bg' => '#FFF3E0', 'progress' => '#F57C00'], ]; $iconData = $iconColors[$campaign->id % count($iconColors)]; // Get creator name $creatorName = $campaign->createdBy ? $campaign->createdBy->full_name : 'Unknown'; $parts = preg_split('/\s+/', trim($creatorName)); $first = $parts[0] ?? ''; $last = $parts[count($parts) - 1] ?? ''; $initials = strtoupper(mb_substr($first, 0, 1) . mb_substr($last, 0, 1)); // Deterministic color for avatar $palette = [ '#FEC84B', // amber '#F97066', // red '#84C5F4', // blue '#6CE9A6', // green '#9B8AFB', // purple '#F7B4A3', // coral '#A3E3F7', // cyan '#FFD3A3', // orange ]; $idx = crc32($creatorName) % count($palette); $avatarBg = $palette[$idx]; @endphp @endforeach @else @endif
Campaign Name {!! \App\Helpers\Helper::sort($routePrefix . '.index', 'title', $orderBy) !!} Fund Raised Goal Raised NFTs Minted Status Action
@php $campaignImageUrl = null; if (is_array($campaign->campaign_image ?? [])) { $campaignImageUrl = $campaign->campaign_image['thumb'] ?? $campaign->campaign_image['original'] ?? null; } elseif (is_string($campaign->campaign_image ?? null) && !empty($campaign->campaign_image)) { $campaignImageUrl = $campaign->campaign_image; } @endphp @if($campaignImageUrl) {{ $campaign->title }} @else
@endif
{{ mb_strlen($campaign->title) > 30 ? mb_substr($campaign->title, 0, 30) . '...' : $campaign->title; }}
{{ $campaign->category->title ?? 'Campaign' }}
{{ $initials }}
{{ $creatorName }} {!! \App\Helpers\Helper::price($campaign->fund_target) !!}
{!! \App\Helpers\Helper::price($campaign->fund_raised) !!} ({{ number_format($progress, 0) }}%)
{{ number_format($totalNftsMinted, 0) }} ● {{ $statusText }}
No Data
@include('admin.components.pagination') @endsection