{{ __('Admin') }} {{ __('Workspaces') }} {{ $workspace->name }}
@if ($workspace->status) Active @else Suspended @endif @if ($workspace->owner)
@csrf
@endif
@csrf
@if (session('success'))
{{ session('success') }}
@endif @if ($errors->any())
    @foreach ($errors->all() as $e)
  • {{ $e }}
  • @endforeach
@endif {{-- Hero --}} @php $initial = mb_strtoupper(mb_substr($workspace->name, 0, 1) ?: '?'); @endphp
Workspace #{{ str_pad((string) $workspace->id, 4, '0', STR_PAD_LEFT) }} · created {{ $workspace->created_at?->toFormattedDateString() }}

{{ $workspace->name }}

{{ $package?->pname ?? 'Free' }} @if ($workspace->slug) {{ $workspace->slug }} @endif @if ($workspace->custom_domain) {{ $workspace->custom_domain }} @if ($workspace->cname_verified) {{ __('verified') }}@else{{ __('pending') }} @endif @endif @if ($workspace->industry) {{ $workspace->industry }} @endif @if ($workspace->country || $workspace->timezone) {{ trim(($workspace->country ?? '') . ' · ' . ($workspace->timezone ?? ''), ' ·') }} @endif {{ $counts['users'] }} users · {{ $counts['devices'] }} {{ __('devices') }} @if ($workspace->owner) Owner: {{ $workspace->owner->name }} @endif
{{ __('MRR') }}
{!! \App\Support\FormatSettings::currency($stats['mrr']) !!}
{{ __('LTV') }}
{!! \App\Support\FormatSettings::currency($stats['ltv']) !!}
{{ __('Health') }}
{{ $stats['health']['label'] }}
{{-- Custom-domain DNS panel — only when domain is set + not verified. --}} @if ($workspace->custom_domain && !$workspace->cname_verified)
DNS verification pending for {{ $workspace->custom_domain }}
Add a CNAME record pointing to cnames.{{ parse_url(config('app.url'), PHP_URL_HOST) }} (subdomain) or an A record to this server's IP (apex). Verification runs every 5 min.
@endif {{-- 6 KPI cards --}}
{{ __('Sent (30d)') }}
{{ number_format($stats['sent30d']) }}
@if ($effLimits['monthly_messages_limit'] ?? false) @php $usagePct = $effLimits['monthly_messages_limit'] > 0 ? round($stats['sent30d'] / $effLimits['monthly_messages_limit'] * 100) : 0; @endphp
{{ $usagePct }}% of cap
@else
{{ __('no cap') }}
@endif
{{ __('Delivered') }}
{{ $stats['deliveredPct'] }}%
{{ number_format($stats['delivered30d']) }} {{ __('msgs') }}
{{ __('Read rate') }}
{{ $stats['readPct'] }}%
{{ number_format($stats['read30d']) }} {{ __('reads') }}
{{ __('Campaigns') }}
{{ $counts['campaigns'] }}
{{ $counts['broadcasts'] }} {{ __('broadcasts') }}
{{ __('Devices') }}
{{ $counts['devices'] }} @if ($effLimits['device_limit'] ?? false) / {{ $effLimits['device_limit'] }} @endif
{{ __('connected') }}
{{ __('Contacts') }}
{{ number_format($counts['contacts']) }}
{{ __('in CRM') }}
{{-- Volume chart + Plan usage --}}
{{ __('Last 30 days') }}

{{ __('Message volume') }}

Sent Delivered
{{ __('Plan usage') }}

vs {{ $package?->pname ?? 'Free' }} caps

@php $progressRows = [ [ 'label' => 'Messages (30d)', 'used' => $stats['sent30d'], 'cap' => $effLimits['monthly_messages_limit'] ?? null, ], [ 'label' => 'Devices', 'used' => $counts['devices'], 'cap' => $effLimits['device_limit'] ?? null, ], [ 'label' => 'Users', 'used' => $counts['users'], 'cap' => $effLimits['user_seat_limit'] ?? null, ], [ 'label' => 'Contacts', 'used' => $counts['contacts'], 'cap' => $effLimits['contacts_limit'] ?? null, ], ]; @endphp @foreach ($progressRows as $r) @php $pct = ($r['cap'] && $r['cap'] > 0) ? min(100, round($r['used'] / $r['cap'] * 100)) : 0; @endphp
{{ $r['label'] }} {{ number_format($r['used']) }} @if ($r['cap']) / {{ number_format($r['cap']) }} @else @endif
@endforeach
{{-- Recent orders + Owner block --}}

{{ __('Recent orders') }}

{{ __('Last 6 from this workspace') }}

{{ __('All orders') }}
@forelse ($recentOrders as $o) @php $tone = match ($o->status) { 'paid' => 'bg-wa-bubble text-wa-deep', 'pending' => 'bg-accent-amber/10 text-accent-amber', 'failed' => 'bg-accent-coral/10 text-accent-coral', 'refunded' => 'bg-[#F3E9FF] text-[#5B3D8A]', default => 'bg-paper-100 text-ink-600', }; @endphp @empty @endforelse
{{ __('Order #') }} {{ __('Plan') }} {{ __('Amount') }} {{ __('Status') }} {{ __('When') }}
{{ $o->order_number }} {{ \App\Models\Package::find($o->package_id)?->pname ?? '—' }} {!! \App\Support\FormatSettings::formatIn((float) ($o->total_amount ?? $o->amount), $o->currency) !!} {{ ucfirst($o->status) }} {{ $o->created_at?->diffForHumans() }}
{{ __('No orders yet.') }}

{{ __('Owner') }}

@if ($workspace->owner) @php $initials = collect(explode(' ', $workspace->owner->name)) ->map(fn($p) => mb_substr($p, 0, 1)) ->take(2) ->implode(''); @endphp
{{ $workspace->owner->name }}
{{ $workspace->owner->email }} @if ($workspace->owner->mobile)
{{ $workspace->owner->mobile }}
@endif
Open owner profile @else
{{ __('No owner attached.') }}
@endif @if ($workspace->admin_note)
{{ __('Admin note') }}
{{ $workspace->admin_note }}
@endif
{{-- Edit form — hidden by default, toggled by "Edit" button. Posts PUT to admin.workspaces.update. --}} {{-- Danger zone --}}
04 {{ __('Danger zone') }} {{ __('irreversible') }}
@csrf
{{ $workspace->status ? 'Suspend workspace' : 'Reactivate workspace' }}
{{ __('Owner can still log in but all dashboards lock until reactivated') }}
@csrf @method('DELETE')
{{ __('Move to trash') }}
{{ __('Recoverable for 30 days') }}