{{ __('Admin') }} {{ __('Users') }}
{{ __('Admin · Platform users') }}

{{ __('All') }} {{ __('users') }}

{{ __('Manage every account on the platform: roles, login-as, status, and trash.') }}

@if (session('success'))
{{ session('success') }}
@endif
{{ __('Total users') }}
{{ number_format($stats['total']) }}
+{{ $stats['thisMonth'] }} {{ __('this month') }}
{{ __('Active') }}
{{ number_format($stats['active']) }}
{{ $stats['total'] > 0 ? round(($stats['active'] / $stats['total']) * 100, 1) : 0 }}% active
{{ __('Suspended') }}
{{ number_format($stats['suspended']) }}
{{ __('policy violations') }}
{{ __('Users') }}
{{ number_format($stats['users']) }}
{{ __('standard user accounts') }}
{{ __('Trashed') }}
{{ number_format($stats['trashed']) }}
{{ __('recoverable 30d') }}
{{-- Filter / search bar — links carry filters back through pagination. --}}
@php $pills = [ 'all' => 'All', 'admin' => 'Admins', 'user' => 'Users', 'agent' => 'Agents', 'suspended' => 'Suspended', ]; $countsByRole = [ 'all' => $stats['total'], 'admin' => $stats['admin'], 'user' => $stats['users'], 'agent' => null, 'suspended' => $stats['suspended'], ]; @endphp @foreach ($pills as $k => $label) @endforeach
@forelse ($users as $u) @php $initials = collect(explode(' ', trim((string) $u->name))) ->map(fn($p) => mb_substr($p, 0, 1)) ->take(2) ->implode(''); $initials = $initials !== '' ? mb_strtoupper($initials) : '?'; $emailVerified = !is_null($u->email_verified_at); $mobileVerified = !is_null($u->mobile_verified_at); $verified = $emailVerified || $mobileVerified; $suspended = $u->role === 'suspended'; $ws = $u->currentWorkspaceRel; $impersonateUrl = $ws ? route('admin.impersonate.start', $ws->id) : null; @endphp {{-- Mobile No — full number WITH country code, UNMASKED (this is the admin's own user list; the sales team needs the real number to call + WhatsApp). tel: dials it; wa.me opens WhatsApp. --}} @php $ucc = preg_replace('/\D+/', '', (string) $u->country_code); $umob = preg_replace('/\D+/', '', (string) $u->mobile); $ue164 = $umob !== '' ? ($ucc !== '' ? $ucc . ltrim($umob, '0') : $umob) : ''; $udisp = $umob !== '' ? ('+' . ($ucc !== '' ? $ucc . ' ' : '') . $u->mobile) : ''; @endphp {{-- Email id — dedicated column, clickable to mail the customer. --}} {{-- Verified by — which channel(s) proved this account: an email link (email_verified_at) and/or a WhatsApp OTP at signup (mobile_verified_at). Both can be set. --}} @empty @endforelse
{{ __('Name') }} {{ __('Mobile No') }} {{ __('Email id') }} {{ __('Workspace') }} {{ __('Joined') }} {{ __('Vfd') }} {{ __('Verified by') }} {{ __('Login') }} {{ __('Status') }}
{{ $u->name }}
@if ($ue164 !== '') {{ $udisp }} @else — @endif {{ $u->email }}
{{ $ws?->name ?? '—' }}
{{ ucfirst($u->role ?? 'user') }}
{{ $u->created_at?->diffForHumans() }} @if ($suspended) @elseif ($verified) @else @endif
@if ($mobileVerified) {{ __('WhatsApp') }} @endif @if ($emailVerified) {{ __('Email') }} @endif @unless ($emailVerified || $mobileVerified) — @endunless
@if ($impersonateUrl && !$suspended)
@csrf
@else @endif
@csrf
{{ __('No users match your filters.') }}
Showing {{ $users->firstItem() ?? 0 }}–{{ $users->lastItem() ?? 0 }} of {{ number_format($users->total()) }} {{ __('users') }}
{{ $users->onEachSide(1)->links() }}