{{-- /admin/workspaces/trash — soft-deleted workspaces with restore / force-delete. Mirrors the /admin/users/trash layout exactly: • Restore → POST /admin/workspaces/{id}/restore • Delete now → DELETE /admin/workspaces/{id}/force (CSRF + confirm) • Empty trash → POST /admin/workspaces/trash/empty (wipes anything past 30 days) Filter pills + search + pagination run through ?filter=&q=. --}}
{{ __('Back to workspaces') }}
@csrf
{{ __('Admin · Workspaces · Trash') }}

{{ __('Trashed') }} {{ __('workspaces') }}

{{ $kpi['total'] }} {{ __('deleted workspaces. Trashed workspaces are recoverable for 30 days, after which they are permanently deleted along with their data.') }}

@if (session('success'))
{{ session('success') }}
@endif @if ($errors->any())
{{ $errors->first() }}
@endif
{{ __('Permanent deletion is irreversible') }}
{{ __('Once a workspace passes the 30-day window or is force-deleted, all its contacts, messages, campaigns 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 ($workspaces as $ws) @php $initials = strtoupper(substr(preg_replace('/\s+/', '', $ws->name ?: $ws->slug), 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[$ws->id % count($palette)]; $daysLeft = max(0, (int) ceil(30 - (float) ($ws->deleted_at?->diffInDays(now()) ?? 0))); $expiringSoon = $daysLeft <= 7; $owner = $owners[$ws->owner_user_id] ?? null; @endphp @empty @endforelse
{{ __('Icon') }} {{ __('Workspace') }} {{ __('Owner') }} {{ __('Trashed') }} {{ __('Auto-delete in') }} {{ __('Plan') }} {{ __('Action') }}
{{ $initials }}
{{ $ws->name ?: '(no name)' }}
{{ $ws->slug }}
@if ($owner)
{{ $owner->name ?: '(no name)' }}
{{ $owner->email }}
@else
{{ __('(no owner)') }}
@endif
{{ $ws->deleted_at?->diffForHumans() ?? '—' }} {{ $daysLeft }} {{ __('days') }} {{ $ws->plan ?: '—' }}
@csrf
@csrf @method('DELETE')
@if ($q || $filter !== 'all') {{ __('No trashed workspaces match those filters.') }} {{ __('Clear filters') }} @else {{ __('Nothing in trash. Workspaces you delete from') }} /admin/workspaces {{ __('show up here for 30 days before being permanently wiped.') }} @endif
@if ($workspaces->total() > 0) {{ __('Showing') }} {{ $workspaces->firstItem() }}–{{ $workspaces->lastItem() }} {{ __('of') }} {{ $workspaces->total() }} {{ __('trashed') }} @else {{ __('No trashed workspaces') }} @endif
{{ __('Auto-deletion runs nightly at 02:00 UTC') }}
@if ($workspaces->hasPages())
{{ $workspaces->links() }}
@endif