@extends('layouts.portal')
@section('title', 'Investor Dashboard')
@section('portal_title', 'Dashboard Overview')
@section('portal_subtitle', 'A quick summary of your profile, plan, payments, and support options.')
@section('portal_content')
@php
$currentPlanName = $subscribedPlan['name'] ?? 'No plan subscribed';
$paymentStatus = $subscribedPlan['status'] ?? 'No payment yet';
$walletBalance = '$' . number_format((float) ($wallet['balance'] ?? 0), 2);
$availableBalance = '$' . number_format((float) ($wallet['available_balance'] ?? ($wallet['balance'] ?? 0)), 2);
$pendingWithdrawal = '$' . number_format((float) ($wallet['pending_withdrawals'] ?? 0), 2);
$totalProfitEarned = '$' . number_format((float) ($wallet['total_profit_earned'] ?? 0), 2);
$isActiveInvestment = in_array($paymentStatus, ['Deposit Approved', 'Payment Completed'], true);
$dashboardAmount = $subscribedPlan && is_numeric($subscribedPlan['amount'] ?? null) ? '$' . number_format((float) $subscribedPlan['amount'], 2) : ($subscribedPlan['amount'] ?? '-');
$dashboardDailyReturn = $subscribedPlan && $isActiveInvestment
? '$' . number_format((float) ($subscribedPlan['daily_return_amount'] ?? portalDailyReturnAmount($subscribedPlan)), 2)
: 'Starts after approval';
@endphp
Wallet Balance Your approved deposits and daily investment profits pile up here automatically. Total Profit Earned {{ $totalProfitEarned }} Available to Withdraw {{ $availableBalance }} Pending Withdrawal {{ $pendingWithdrawal }}{{ $walletBalance }}
{{ $stat['label'] }}
{{ $stat['value'] }} @endforeachCurrent Investment Plan
{{ $subscribedPlan ? 'Your active or pending investment summary.' : 'No investment plan has been subscribed to yet.' }}
{{ $label }}
{{ $value }}
Status: {{ $paymentStatus }}
@endif