{{-- /admin/users/trash — list soft-deleted users with restore / force-delete actions. Mirrors the prototype layout but every row, count, and button is wired: • Restore → POST /admin/users/{id}/restore • Delete now → DELETE /admin/users/{id}/force (CSRF + confirm) • Empty trash → POST /admin/users/trash/empty (wipes anyone past the 30-day grace window) Filter pills + search + pagination all run through ?filter=&q=. --}}
Back to users
@csrf
{{ __('Admin · Users · Trash') }}

{{ __('Trashed') }} {{ __('users') }}

{{ $kpi['total'] }} deleted accounts. Trashed users are recoverable for 30 days, after which they're permanently deleted along with their data.

@if (session('success'))
{{ session('success') }}
@endif @if ($errors->any())
{{ $errors->first() }}
@endif
{{ __('Permanent deletion is irreversible') }}
{{ __('Once a user passes the 30-day window or is force-deleted, all linked contacts, messages, and audit records are wiped per our retention policy.') }}
@php $pills = [['key' => 'all', 'label' => 'All trashed', 'count' => $kpi['total']], ['key' => 'recent', 'label' => 'Last 7 days', 'count' => $kpi['recent']], ['key' => 'expiring', 'label' => 'Expiring soon', 'count' => $kpi['expiring']]]; @endphp @foreach ($pills as $p) {{ $p['label'] }} {{ $p['count'] }} @endforeach
@if ($filter !== 'all') @endif
@forelse ($users as $u) @php $initials = strtoupper(substr(preg_replace('/\s+/', '', $u->name ?: $u->email), 0, 2)); $palette = [ ['bg' => 'bg-paper-100', 'text' => 'text-ink-500'], ['bg' => 'bg-[#FFF4E0]', 'text' => 'text-[#7B5A14]'], ['bg' => 'bg-[#F3E9FF]', 'text' => 'text-[#5B3D8A]'], ['bg' => 'bg-wa-bubble', 'text' => 'text-wa-deep'], ['bg' => 'bg-[#D9E5F2]', 'text' => 'text-[#13478A]'], ]; $pal = $palette[$u->id % count($palette)]; $daysLeft = max(0, 30 - $u->deleted_at?->diffInDays(now())); $expiringSoon = $daysLeft <= 7; $rowCls = $expiringSoon ? 'hover:bg-paper-50/60 bg-accent-amber/10' : 'hover:bg-paper-50/60'; @endphp @empty @endforelse
{{ __('Image') }} {{ __('User') }} {{ __('Workspace') }} {{ __('Trashed') }} {{ __('Auto-delete in') }} {{ __('Role') }} {{ __('Action') }}
{{ $initials }}
{{ $u->name ?: '(no name)' }}
{{ $u->email }}@if ($u->phone) · {{ $u->phone }} @endif
@if ($u->currentWorkspace)
{{ $u->currentWorkspace->name }}
@else
(no workspace)
@endif
{{ $u->deleted_at?->diffForHumans() ?? '—' }} {{ $daysLeft }} {{ __('days') }} {{ $u->role ?: 'user' }}
@csrf
@csrf @method('DELETE')
@if ($q || $filter !== 'all') No trashed users match those filters. {{ __('Clear filters') }} @else Nothing in trash. Users you delete from /admin/users show up here for 30 days before being permanently wiped. @endif
@if ($users->total() > 0) Showing {{ $users->firstItem() }}–{{ $users->lastItem() }} of {{ $users->total() }} trashed @else No trashed users @endif
{{ __('Auto-deletion runs nightly at 02:00 UTC') }}
@if ($users->hasPages())
{{ $users->links() }}
@endif