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

Total Invested

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

Total ROI Earned

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

All Plans

{{ $stats['total_count'] }}

Active

{{ $stats['active_count'] }}

Completed

{{ $stats['completed'] }}

{{-- ─── Filters ─────────────────────────────────────────────────────────────── --}}
@if(request('status')) Clear @endif
{{-- ─── Table ───────────────────────────────────────────────────────────────── --}} @if($investments->isEmpty()) @else
@foreach($investments as $inv) @php $invStatus = $inv->status instanceof \BackedEnum ? $inv->status->value : (string) $inv->status; $sc = ['active'=>'emerald','completed'=>'blue','cancelled'=>'red','expired'=>'gray']; $accrued = (float) ($inv->accrued_return ?? 0); $expected = (float) ($inv->expected_return ?? 0); $roiPct = $inv->amount > 0 ? round(($accrued / $inv->amount) * 100, 1) : 0; @endphp {{-- Plan --}} {{-- Invested --}} {{-- ROI earned --}} {{-- Expected --}} {{-- Started --}} {{-- Ended / Expires --}} {{-- Status --}} {{-- Actions --}} @endforeach
Plan Invested Status

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

{{ $inv->duration ?? $inv->plan?->duration ?? '—' }}

${{ number_format($inv->amount, 2) }} {{ $invStatus }} Details
{{-- Pagination + totals footer --}}
Showing {{ $investments->count() }} of {{ $investments->total() }} Page ROI: +${{ number_format($investments->sum('accrued_return'), 2) }}
{{ $investments->withQueryString()->links() }}
@endif