@extends('admin.adminLayout') @section('admin_page_title') Client: {{ $client->full_name }} @endsection @section('admin_content') @php $ownerName = optional($client->owner)->name; $tradingAccounts = collect($client->tradingAccounts ?? [])->filter(fn ($account) => !empty($account->mt5_login))->values(); $mt4 = $tradingAccounts->firstWhere('is_primary', true) ?? $tradingAccounts->first(); $hasMt4 = !empty($mt4) && !empty($mt4->mt5_login); $credentialAdmin = \Illuminate\Support\Facades\Auth::guard('web')->user(); $canViewMt4Credentials = $credentialAdmin instanceof \App\Models\User && $credentialAdmin->status_active === 'yes' && ($credentialAdmin->is_super_admin === 'yes' || ($credentialAdmin->can('clients_access') && $credentialAdmin->can('clients_view') && $credentialAdmin->can('clients_change_password'))); $canChangeMt4Password = $credentialAdmin instanceof \App\Models\User && $credentialAdmin->status_active === 'yes' && $credentialAdmin->can('clients_access') && $credentialAdmin->can('clients_view') && $credentialAdmin->can('clients_edit'); $clientInitials = collect(preg_split('/\s+/', trim((string) $client->full_name))) ->filter() ->take(2) ->map(fn ($part) => mb_strtoupper(mb_substr($part, 0, 1))) ->implode('') ?: 'CL'; $clientSinceText = $stats->client_since ? \Carbon\Carbon::parse($stats->client_since)->format('d M Y') : '—'; @endphp

{{ $client->full_name }}

@if($client->status === 'active') Active @elseif($client->status) {{ ucfirst($client->status) }} @endif
{{ $client->email }} {{ $displayPhone ?: 'No phone' }} {{ $ownerName ?: 'Unassigned' }} Client since {{ $clientSinceText }}
@if(!empty($clientActionsHtml))
{!! $clientActionsHtml !!}
@endif Back to clients
MT4 Accounts{{ $tradingAccounts->count() }}{{ $hasMt4 ? 'Primary #'.$mt4->mt5_login : 'No account linked' }}
Account Limit{{ $client->effectiveMt4AccountLimit() }}Client-specific allowance
Related Leads{{ $stats->total_leads }}{{ $stats->last_lead_date ? 'Last '.\Carbon\Carbon::parse($stats->last_lead_date)->format('d M Y') : 'No recent lead' }}
Location{{ $client->country ?: '—' }}{{ $client->city ?: 'City not set' }}
Client Status{{ ucfirst($client->status ?: 'Unknown') }}Profile and access state
@include('admin.clients.partials.login-information')
Trading workspace

MT4 Trading Accounts

Every statistic and financial operation is scoped to the selected MT4 login.

@if($hasMt4) @can('clients_edit') @endcan @endif @can('clients_edit') @endcan
@if($tradingAccounts->isNotEmpty()) @endif @if(!$hasMt4) @else
Live MT4 dataProvider values for the selected login
Live
Balance—
Equity—
Margin—
Free Margin—
Credit—
Account audit summaryFinancial history recorded by the platform
Total Deposit—
Total Withdrawal—
Total Credit In—
Total Credit Out—
@endif
@if($hasMt4)
Financial ledger

MT4 Transactions

Deposits, withdrawals, credits and administrator operations.

TicketActionAmountStatusAdminTimeAction
Live exposure

MT4 Open Positions

All active market and pending positions for the selected account.

OrderSymbolTypeVolumePriceSLTPProfitSetup TimeAction
Trading history

MT4 Closed Deals

Completed deals with prices, realised profit and execution time.

OrderSymbolTypeVolumePriceSLTPProfitDone TimeAction
@endif
Client record

Profile Information

Email
{{ $client->email }}
Phone
{{ $displayPhone ?: '—' }}
Country
{{ $client->country ?: '—' }}
City
{{ $client->city ?: '—' }}
Address
{{ $client->address ?: '—' }}
Owner
{{ $ownerName ?: 'Unassigned' }}
MT4 account limit
{{ $client->effectiveMt4AccountLimit() }}
Client since
{{ $stats->client_since ? \Carbon\Carbon::parse($stats->client_since)->format('d M Y H:i') : '—' }}
Acquisition history

Related Leads

Latest lead records matched by email or phone.

{{ $stats->total_leads }} found
@if($hasMt4 && $canViewMt4Credentials) @include('admin.clients.partials.mt4-credentials-modal') @endif @if($hasMt4 && $canChangeMt4Password) @include('admin.clients.partials.mt4-password-modal') @endif
@endsection @section('script') @if($hasMt4 && $canViewMt4Credentials) @endif @include('admin.clients.partials.presence-assets') @if($hasMt4 && $canChangeMt4Password) @endif @endsection @section('style') @endsection