@extends('appshell::layouts.private') @section('title') {{ $user->name }} @stop @section('content') {{-- Quick-access menu for this user --}}
Backup Records Backup Operations
@component('appshell::widgets.card_with_icon', [ 'icon' => 'user', 'type' => 'primary' ]) {{ $user->name }} @slot('subtitle') {{ $user->email }} @endslot @endcomponent
@component('appshell::widgets.card_with_icon', ['icon' => 'time', 'type' => 'info']) {{ __('Created at') }} {{ show_datetime($user->created_at) }} @slot('subtitle') {{ __('Last login') }} {{ optional($user->last_login_at) ? show_datetime($user->last_login_at) : __('N/A') }} @endslot @endcomponent

{{ __('Plugin Authorized At') }}: {{ $user->plugin_authorized_at ? show_datetime($user->plugin_authorized_at) : __('(not authorized)') }}

{{ __('Plugin Revoked At') }}: {{ $user->plugin_revoked_at ? show_datetime($user->plugin_revoked_at) : __('(not revoked)') }}

@csrf @if($user->is_auth_token) @else @endif

{{ __('Pending Plugin Domain') }}: {{ $user->plugin_pending_domain ?? __('(none)') }}

{{ __('Pending Plugin IP') }}: {{ $user->plugin_pending_ip ?? __('(none)') }}

{{ __('Plugin Last Connected At') }}: {{ $user->plugin_last_connected_at ? show_datetime($user->plugin_last_connected_at) : __('(never)') }}

@csrf
{{ __('Plugin Public Key (PEM)') }}

{{ $user->plugin_key ?? __('(not set)') }}

@csrf
@if(session('new_public_key'))
{{ __('New public key generated') }}
{{ session('new_public_key') }}
@endif @if(!empty($privatePartial))
{{ __('Private Key Info (masked)') }}

{{ __('Fingerprint') }}: {{ $privateFingerprint }}

{{ __('Private Key (partial, masked)') }}:

{{ $privatePartial }}
@endif
{{ __('Domain Binding') }}
@php $dh = $user->plugin_domain_hash; $masked = $dh ? (substr($dh, 0, 6) . '...' . substr($dh, -6)) : __('(none)'); @endphp

{{ __('Domain Hash (masked)') }}: {{ $masked }}

@csrf
@csrf
{{ __('Addresses') }}
{{ __('Purchased Products') }}
@if(isset($purchasedProducts) && $purchasedProducts->isNotEmpty()) @foreach($purchasedProducts as $p) @endforeach
{{ __('SKU') }} {{ __('Name') }} {{ __('Quantity') }} {{ __('Subscriptions') }}
{{ $p['sku'] }} {{ $p['name'] }} {{ $p['quantity'] }} @php $subs = collect($p['subscriptions'] ?? []); $now = \Carbon\Carbon::now(); $current = $subs->first(function($s) use ($now) { return isset($s['start'], $s['expiry']) && $s['start'] && $s['expiry'] && $s['start']->lte($now) && $s['expiry']->gte($now); }); $last = $subs->sortByDesc(function($s) { return isset($s['expiry']) && $s['expiry'] ? $s['expiry']->getTimestamp() : 0; })->first(); @endphp @if($current)
{{ $current['start']->format('Y-m-d') }} — {{ $current['expiry']->format('Y-m-d') }}
@elseif($last) @php $expired = isset($last['expiry']) && $last['expiry'] && $last['expiry']->lt($now); @endphp
{{ optional($last['start'])->format('Y-m-d') ?? '-' }} @if(!empty($last['expiry'])) — {{ $last['expiry']->format('Y-m-d') }} @endif
@else @endif
@else

{{ __('No purchased products found.') }}

@endif
{{ __('Gifted Products') }}
@csrf

{{ __('Existing Gifts') }}
@if(isset($giftedProducts) && $giftedProducts->isNotEmpty()) @foreach($giftedProducts as $gift) @endforeach
{{ __('SKU') }} {{ __('Name') }} {{ __('Start') }} {{ __('End') }}
{{ $gift->sku }} {{ $gift->name }} {{ $gift->start_date ? $gift->start_date->format('Y-m-d') : '-' }} {{ $gift->end_date ? $gift->end_date->format('Y-m-d') : '-' }}
@csrf
@csrf @method('DELETE')
{{ __('Edit') }}
@csrf
@else

{{ __('No gifted products found.') }}

@endif
{{ __('Plugin Downloads') }}
@if(!empty($downloadStats) && count($downloadStats) > 0) @foreach($downloadStats as $index => $stat) @endforeach
{{ __('Plugin') }} {{ __('Total Downloads') }} {{ __('Last Downloaded') }}
{{ $stat['name'] }} {{ $stat['sku'] }} {{ $stat['total_downloads'] }} {{ $stat['last_downloaded_at']->format('Y-m-d H:i:s') }}
{{ __('Download History') }}: {{ $stat['name'] }}
@csrf
@if($stat['downloads']->count() > 0)

{{ __('Showing') }} {{ ($stat['downloads_page'] - 1) * $stat['downloads_per_page'] + 1 }} {{ __('to') }} {{ min($stat['downloads_page'] * $stat['downloads_per_page'], $stat['downloads_total']) }} {{ __('of') }} {{ $stat['downloads_total'] }} {{ __('downloads') }}

@foreach($stat['downloads'] as $download) @endforeach
{{ __('Date') }} {{ __('IP Address') }} {{ __('Filename') }} {{ __('User Agent') }}
{{ $download->downloaded_at->format('Y-m-d H:i:s') }} {{ $download->ip_address ?? '—' }} {{ $download->filename }} {{ $download->user_agent ?? '—' }}
@if($stat['downloads_total'] > $stat['downloads_per_page']) @endif @else

{{ __('No download details available.') }}

@endif
@else

{{ __('No plugin downloads recorded yet.') }}

@endif
{{ __('Orders') }}
@foreach($orders as $order) @endforeach
{{ __('Number') }} {{ __('Date') }} {{ __('Status') }} {{ __('Total') }}
{{ $order->number }} {{ show_datetime($order->ordered_at) }} {{ $order->status }} {{ $order->total() }} {{ __('View') }}
{{ $orders->links() }}
{{-- Danger Zone --}}
{{ __('Danger Zone') }}

{{ __('Permanently delete this user and all associated records — orders, payments, downloads, affiliate data, subscriptions, and more. This action cannot be undone.') }}

@if(auth()->id() === $user->id) @else
@csrf @method('DELETE')
@endif
{{-- apwp-ao Plugin Key --}}
{{ __('Admin Menu Organizer — Plugin Key') }}
@if($aoPluginKey)
@csrf
@else

{{ __('No key generated yet.') }}

@csrf
@endif
{{-- apwp-ao Domain Slots --}}
{{ __('Admin Menu Organizer — Domain Slots') }} ({{ $aoDomains->where('is_active', true)->count() }} active / {{ $aoAllowedSlots }} allowed)
@if($aoDomains->isEmpty())

{{ __('No domain slots on record for this user.') }}

@else @foreach($aoDomains as $aoSlot) @endforeach
{{ __('ID') }} {{ __('Label') }} {{ __('Status') }} {{ __('Authorized') }} {{ __('Last Connected') }} {{ __('Released') }} {{ __('Actions') }}
{{ $aoSlot->id }} {{ $aoSlot->domain_label ?? '—' }} @if($aoSlot->is_active) {{ __('Active') }} @elseif($aoSlot->released_at) {{ __('Released') }} @else {{ __('Pending') }} @endif {{ $aoSlot->authorized_at ? $aoSlot->authorized_at->format('Y-m-d H:i') : '—' }} {{ $aoSlot->last_connected_at ? $aoSlot->last_connected_at->diffForHumans() : '—' }} {{ $aoSlot->released_at ? $aoSlot->released_at->format('Y-m-d') : '—' }} @if($aoSlot->is_active)
@csrf
@else — @endif
@endif
@push('scripts') @endpush @stop