{{-- Search + filter bar --}}
{{ $rows->total() }} {{ Str::plural(__('member'), $rows->total()) }}
@forelse ($rows as $row) {{-- User --}} {{-- Role --}} {{-- Key status --}} {{-- Orders placed via API --}} {{-- Last active (proxied from last API order) --}} {{-- Actions --}} @empty @endforelse
{{ __('Staff member') }} {{ __('Role') }} {{ __('API key') }} {{ __('API orders') }} {{ __('Last active') }} {{ __('Action') }}
{{ $row->name }}
{{ $row->email }}
{{ __(ucwords(str_replace('_', ' ', $row->roles->first()?->name ?? ($row->is_super ? 'super admin' : '—')))) }} @if ($row->api_key_hash) •••• {{ strtoupper(substr($row->api_key_hash, -8)) }} @else {{ __('No key yet') }} @endif @if ($row->api_orders_count > 0) {{ number_format($row->api_orders_count) }} @else — @endif @if ($row->api_last_used) {{ \Carbon\Carbon::parse($row->api_last_used)->diffForHumans() }} @else {{ __('Never used') }} @endif @if ($row->api_key_hash) @else — @endif
@if ($rows->hasPages())
{{ $rows->links() }}
@endif
{{-- Info card --}}

{{ __('How this works') }}

  • {{ __('Keys are stored as SHA-256 hashes. You cannot read the plaintext key — only the user saw it at creation time.') }}
  • {{ __('Revoking a key is instant. The user must visit /app/api to generate a new one.') }}
  • {{ __('\'Last active\' is approximated from the most recent order placed via the API. Users who only check balance or list services appear as never used.') }}
  • {{ __('Suspending a user account (from Users) blocks their API access immediately without revoking the key.') }}

{{ __('Quick stats') }}

@php $staffTotal = \App\Models\User::where(fn($q) => $q->where('is_super', true) ->orWhereHas('roles', fn($r) => $r->whereNotIn('name', ['client','reseller_staff'])))->count(); $keysIssued = \App\Models\User::whereNotNull('api_key_hash')->count(); $apiOrders = \App\Models\Order::where('source','api')->count(); @endphp
{{ __('Total staff') }}
{{ number_format($staffTotal) }}
{{ __('Keys issued') }}
{{ number_format($keysIssued) }}
{{ __('Total API orders') }}
{{ number_format($apiOrders) }}