@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

{{ $walletBalance }}

Your approved deposits and daily investment profits pile up here automatically.

Total Profit Earned

{{ $totalProfitEarned }}

Available to Withdraw

{{ $availableBalance }}

Pending Withdrawal

{{ $pendingWithdrawal }}

Deposit to Wallet Withdraw Funds
@foreach ([ ['label' => 'Account Status', 'value' => 'Verified', 'url' => '/portal/profile'], ['label' => 'Wallet Balance', 'value' => $walletBalance, 'url' => '/portal/wallet'], ['label' => 'Available Withdrawal', 'value' => $availableBalance, 'url' => '/portal/withdrawal'], ['label' => 'Subscribed Plan', 'value' => $currentPlanName, 'url' => '/portal/my-plan'], ] as $stat)

{{ $stat['label'] }}

{{ $stat['value'] }}
@endforeach

Current Investment Plan

{{ $currentPlanName }}

{{ $subscribedPlan ? 'Your active or pending investment summary.' : 'No investment plan has been subscribed to yet.' }}

View My Plan
@if ($subscribedPlan)
@foreach ([ 'Name' => $currentPlanName, 'Amount' => $dashboardAmount, 'Daily Profit' => $subscribedPlan['profit'] ?? '-', 'Daily Return' => $dashboardDailyReturn, 'Duration' => $subscribedPlan['period'] ?? '-', ] as $label => $value)

{{ $label }}

{{ $value }}

@endforeach

Status: {{ $paymentStatus }}

@endif
@endsection