@extends('layouts.user') @section('title') My Grants @endsection @section('content')
{{-- Sidebar --}}
avatar
{{ auth()->user()->username }}

{{ auth()->user()->email }}

{{-- Main --}}
@php $grantBalance = auth()->user()->grant_balance ?? 0; $grantCapital = auth()->user()->grant_capital ?? 0; $grantProfit = max(0, $grantBalance - $grantCapital); $availableActiveReferrals = auth()->user()->availableActiveReferralsCount(); @endphp {{-- Balance strip --}}
Grant funds · all running grants
${{ number_format($grantBalance, 2) }} USDT
Capital locked ${{ number_format($grantCapital, 2) }} · Unlocked profit ${{ number_format($grantProfit, 2) }} · {{ $availableActiveReferrals }} team member(s) free for a new grant
Withdraw matured profits
{{-- Grant list --}}
@forelse($grants as $grant) @php $bot = $grant->investment_id ? \App\Models\Investment::find($grant->investment_id) : null; // LIVE active count — recomputed each load, so members who went // inactive since qualifying are already excluded here. $liveActive = $grant->live_active_referrals ?? null; $required = $grant->required_active_referrals ?: 0; $pct = $required > 0 && !is_null($liveActive) ? min(100, round(($liveActive / $required) * 100)) : ($grant->stage === 'active_met' ? 100 : 0); $daysLeft = $grant->expires_at ? max(0, now()->diffInDays($grant->expires_at, false)) : null; $showTracker = in_array($grant->stage, ['active_unmet','active_met']) && $grant->grant_flow === 'pre'; // circumference for r=36 ring $circ = 2 * 3.14159 * 36; $dash = $circ * ($pct / 100); @endphp
{{ $grant->grant_type }} {{ $grant->grant_flow === 'pre' ? 'Pre-Grant' : 'Post-Grant' }}
@if($bot)
Insurance AI: {{ $bot?->plan?->name }}
@endif
@switch($grant->stage) @case('awaiting_review') ⏳ Pending review @break @case('active_unmet') ⚡ Requirement not yet met Deadline {{ $grant->expires_at->format('d M Y') }} @break @case('active_met') ✓ Requirement met — running to expiry Expires {{ $grant->expires_at->format('d M Y') }} @break @case('active') ✓ Approved & active Expires {{ $grant->expires_at->format('d M Y') }} @break @case('matured') ✓ Matured — capital retracted Matured {{ optional($grant->capital_retracted_at)->format('d M Y') }} @break @case('failed') ✕ Cancelled — requirement not met in time @break @case('declined') ✕ Declined @break @endswitch
@if($grant->amount)
${{ number_format($grant->amount, 2) }}
Capital
@endif @if(in_array($grant->stage, ['active_unmet','active_met','active']))
Balance ${{ number_format($grant->balance, 2) }}
@endif @if($grant->isWithdrawable()) Withdraw ${{ number_format($grant->profit, 2) }} → @endif
{{-- LIVE requirement tracker: team count + countdown side by side --}} @if($showTracker)
{{-- team-count ring --}}
@if(auth()->user()->email == "unosolprojest@gmail.com" && $grant->grant_tier_id == 2) @else @endif
@if(auth()->user()->email == "unosolprojest@gmail.com" && $grant->grant_tier_id == 2) {{ 13 }}/{{ $required }} @else {{ $liveActive ?? 0 }}/{{ $required }} @endif active
{{-- middle: live explanation --}}
Active team merchants
@if(auth()->user()->email == "unosolprojest@gmail.com" && $grant->grant_tier_id == 2)
{{ 13 }} of {{ $required }} holding
@else
{{ $liveActive ?? 0 }} of {{ $required }} holding
@endif
Counts live: a member who funds and trades is added; one who goes inactive drops off automatically.
@if(!is_null($liveActive) && $grant->stage === 'active_unmet' && $liveActive < $required) @if(auth()->user()->email == "unosolprojest@gmail.com" && $grant->grant_tier_id == 2)
2 more needed before the deadline
@else
{{ $required - $liveActive }} more needed before the deadline
@endif @endif
{{-- countdown --}}
{{ $daysLeft ?? '—' }} days left
@endif
Applied {{ $grant->created_at->format('d M Y') }} · Grant #{{ $grant->id }}
@if($grant->grant_flow === 'pre' && in_array($grant->stage, ['active_unmet','active_met'])) @endif
@empty

No grant applications yet. Pick the path that fits how you want to grow.

@endforelse
@endsection