@php $roiPct = $stats['total_invested'] > 0 ? ($stats['total_roi'] / $stats['total_invested']) * 100 : 0; @endphp
{{-- ─── Header ──────────────────────────────────────────────────────────── --}}

Investments

Put your capital to work with fixed-return investment plans.

{{-- ─── Summary stats ───────────────────────────────────────────────────── --}}

Total Invested

${{ number_format($stats['total_invested'], 2) }}

ROI Earned

+${{ number_format($stats['total_roi'], 2) }}

{{ number_format($roiPct, 1) }}% of capital

Active Plans

{{ $stats['active_count'] }}

{{-- ─── Tabs ────────────────────────────────────────────────────────────── --}}
{{-- ═══════════════════ PLANS ═══════════════════ --}}
@if($plans->isEmpty()) @else
@foreach($plans as $plan) @php $isPct = $plan->return_type?->value === 'percentage'; @endphp
{{-- Accent bar --}}

{{ $plan->name }}

{{ str_replace('_', ' ', $plan->category ?? '') }}

{{ $plan->duration }}
{{-- Headline return --}}
{{ rtrim(rtrim(number_format($plan->return, 2), '0'), '.') }}{{ $isPct ? '%' : '' }} {{ $isPct ? 'return' : 'USD return' }}
{{-- Detail grid --}}

Min

${{ number_format($plan->min_amount, 0) }}

Max

${{ number_format($plan->max_amount, 0) }}

Payout

{{ str_replace('_', ' ', $plan->payout_interval?->value ?? 'At maturity') }}

@if($plan->rating)
@for($i = 1; $i <= 5; $i++) @endfor
@endif
{{-- Invest modal --}}

Invest in {{ $plan->name }}

Min: ${{ number_format($plan->min_amount, 2) }} · Max: ${{ number_format($plan->max_amount, 2) }}

@csrf @php $totalBonus = ($user->bonus ?? 0) + ($user->ref_bonus ?? 0) + ($user->signup_bonus ?? 0); @endphp @if($totalBonus > 0) @endif
@endforeach
@endif
{{-- ═══════════════════ MY INVESTMENTS ═══════════════════ --}}
@if($myInvestments->isEmpty()) @else
@foreach($myInvestments as $inv) @php $sc = ['active'=>'emerald','completed'=>'blue','cancelled'=>'red','expired'=>'gray']; $invStatus = $inv->status instanceof \BackedEnum ? $inv->status->value : (string) $inv->status; @endphp @endforeach
Plan Amount Status

{{ $inv->plan->name ?? 'N/A' }}

{{ $inv->created_at->format('M d, Y') }}

${{ number_format($inv->amount, 2) }} {{ $invStatus }}
View @if($invStatus === 'active') ·
@csrf
@endif
@if($myInvestments->hasPages())
{{ $myInvestments->links() }}
@endif
@endif