@extends('wallet.layouts.master') @section('title','Dashboard') @section('description', 'Company Dashboard') @php $fmtDate = function ($dt) { if (! $dt) return '—'; try { return \Illuminate\Support\Carbon::parse($dt)->format('M j, Y, g:i A'); } catch (\Throwable $e) { return (string) $dt; } }; $monthLabel = \Illuminate\Support\Carbon::now()->format('F Y'); $userCounts = collect($users_counts ?? [])->map(fn ($c) => (int) $c)->values()->all(); $userDates = collect($users_dates ?? [])->map(fn ($d) => (string) $d)->values()->all(); $registrationSparkSource = array_slice($userCounts, -12); $registrationSparkMax = max(1, ...$registrationSparkSource); $registrationSparkBars = array_map( fn ($count) => $count > 0 ? max(24, (int) round(($count / $registrationSparkMax) * 100)) : 8, $registrationSparkSource ); $smsSeries = array_values(array_map('intval', $sms_counts ?? [])); $hasUserChart = array_sum($userCounts) > 0; $hasSmsChart = collect($sms_counts ?? [])->sum() > 0; $smsLabels = array_map( fn ($s) => ucfirst(strtolower(str_replace('NOTDELIVERED', 'Not delivered', $s))), array_keys($sms_counts ?? []) ); $treasuryTotal = collect($treasuryCards ?? [])->sum('usd_value'); $stats = [ ['label' => 'Registered users', 'value' => $total_users, 'icon' => 'ti-users', 'color' => 'primary', 'meta' => ($total_users_last_30_days ?? 0).' in the last 30 days', 'link' => route('users'), 'spark' => $registrationSparkBars], ['label' => 'Pending activation', 'value' => $pending_activations ?? 0, 'icon' => 'ti-user-exclamation', 'color' => 'warning', 'meta' => 'Awaiting email confirmation', 'link' => route('users'), 'spark' => []], ['label' => 'Open tickets', 'value' => $open_tickets, 'icon' => 'ti-ticket', 'color' => 'danger', 'meta' => $open_tickets_current_month.' opened this month', 'link' => route('tickets'), 'spark' => []], ['label' => 'Resolved tickets', 'value' => $close_tickets, 'icon' => 'ti-circle-check', 'color' => 'success', 'meta' => $close_tickets_current_month.' resolved this month', 'link' => route('tickets'), 'spark' => []], ]; @endphp @section('page-css') @endsection @section('content')
Overview for {{ $monthLabel }}
New clients per day, {{ $registrationWindowLabel ?? 'last 30 days' }}
Share a joining code or add a client from the Users page.
Messages sent in {{ $monthLabel }}
Delivery statistics will appear here.
Treasury balances from your CryptoAPIs HD wallet
Add your CryptoAPIs key to issue deposit addresses and track gas balances.
Add API key| Asset | Address | Balance | Value |
|---|---|---|---|
|
@if(!empty($wallet['image']))
{{ substr($wallet['title'], 0, 1) }}
@endif
{{ $wallet['title'] }}
{{ $wallet['network_note'] }}
@if(!empty($wallet['is_gas']))
Gas
@endif
|
@if($wallet['address'] !== '')
{{ $wallet['address'] }}
@else
—
@endif
|
{{ rtrim(rtrim(number_format((float) $wallet['balance'], 8, '.', ','), '0'), '.') ?: '0' }} {{ $wallet['title'] }} | ${{ number_format((float) ($wallet['usd_value'] ?? 0), 2) }} |
Last 10 deposits and withdrawals across your clients
| Client | Type | Amount | USD | Coin | Conf. | Date |
|---|---|---|---|---|---|---|
|
@if($client)
{{ strtoupper(substr($clientName, 0, 1)) }}
{{ $clientName }}
{{ $client->email }}
|
{{ $isDeposit ? 'Deposit' : 'Withdrawal' }} | {{ $isDeposit ? '+' : '-' }}{{ $trans->amount }} | ${{ number_format((float) $trans->usd_amount, 2) }} | {{ $trans->coin_short_name }} | {{ $trans->confirmations ?? 0 }} | {{ $fmtDate($trans->date ?: $trans->created_at) }} |
Client deposits and withdrawals will show up here.