@php use App\Enums\TenantStatus; $fmt = app(\App\Services\Formatter::class); $canManage = auth()->user()?->canManageTenants(); @endphp
{{ $tenant->status->label() }} @if ($canManage)
@php $menu = [ ['extend', 'calendar', 'Extend / shorten term'], ['change-plan', 'layers', 'Change plan'], ['grant', 'sparkles', 'Grant a paid term'], ['note', 'doc', 'Add a note'], ]; @endphp @foreach ($menu as [$key, $icon, $label]) @endforeach
@if ($tenant->status === TenantStatus::Pending) @endif @if ($tenant->isSuspended()) @else @endif @if ($subscription) @endif
@endif
@if ($tenant->isSuspended())

Suspended {{ $fmt->dateTime($tenant->suspended_at) }}

{{ $tenant->suspension_reason }}

@endif {{-- ------------------------------------------------------------- tiles --}}
{{-- ---------------------------------------------------------- overview --}} @if ($tab === 'overview')
@foreach ([ 'Business name' => $tenant->business_name, 'Type' => $tenant->business_type ? ucfirst($tenant->business_type) : '—', 'Slug' => $tenant->slug, 'City' => $tenant->city ?: '—', 'Address' => $tenant->address ?: '—', 'Referred by' => $tenant->referral_source ?: '—', ] as $label => $value)
{{ $label }}
{{ $value }}
@endforeach
@foreach ([ 'Name' => $tenant->owner_name, 'Email' => $tenant->owner_email, 'Phone' => $tenant->owner_phone ?: '—', 'CNIC' => $tenant->owner_cnic ?: '—', 'Last seen' => $fmt->ago($tenant->last_activity_at), 'Approved' => $tenant->approved_at ? $fmt->date($tenant->approved_at) : 'Not yet', ] as $label => $value)
{{ $label }}
{{ $value }}
@endforeach
@if ($subscription) @php $catalogue = config('thinkrax.products.'.($tenant->product?->slug ?? ''), []); $featureLabels = $catalogue['features'] ?? []; $limitLabels = $catalogue['limits'] ?? []; @endphp

Features

    @forelse ($subscription->features() as $feature)
  • {{ $featureLabels[$feature] ?? $feature }}
  • @empty
  • No gated features.
  • @endforelse

Limits

    @forelse ($subscription->limits() as $key => $value)
  • {{ $limitLabels[$key] ?? $key }} {{ (int) $value < 0 ? 'Unlimited' : number_format((int) $value) }}
  • @empty
  • No caps.
  • @endforelse
@endif @if ($tenant->admin_notes)

{{ $tenant->admin_notes }}

@else @endif @if ($canManage) Add a note @endif
@endif {{-- ----------------------------------------------------- subscriptions --}} @if ($tab === 'subscriptions') @if ($subscriptions->isEmpty()) @else PlanCycleAmount StatusStartsEnds @foreach ($subscriptions as $row) {{ $row->plan?->name ?? '—' }} @if ($row->is_trial) Trial @endif {{ $row->billing_cycle->label() }} {{ $fmt->money($row->amount) }} {{ $row->effectiveStatus()->label() }} {{ $fmt->date($row->starts_at) }} {{ $fmt->date($row->ends_at) }} @endforeach @endif @endif {{-- --------------------------------------------------------- invoices --}} @if ($tab === 'invoices') @if ($invoices->isEmpty()) @else NumberPeriodTotal PaidStatusDue @foreach ($invoices as $invoice) {{ $invoice->invoice_number }} {{ $fmt->date($invoice->period_start) }} → {{ $fmt->date($invoice->period_end) }} {{ $fmt->money($invoice->total) }} {{ $fmt->money($invoice->paid_amount) }} {{ $invoice->status->label() }} {{ $fmt->date($invoice->due_on) }} @if ($invoice->isOverdue()) Overdue @endif @endforeach @endif @endif {{-- --------------------------------------------------------- payments --}} @if ($tab === 'payments') @if ($payments->isEmpty()) @else ReferenceMethodAmount Transaction IDStatusSubmitted @foreach ($payments as $payment) {{ $payment->reference }} {{ $payment->gateway->label() }} {{ $fmt->money($payment->amount) }} {{ $payment->transaction_id ?: '—' }} {{ $payment->status->label() }} {{ $fmt->dateTime($payment->created_at) }} @endforeach @endif @endif {{-- --------------------------------------------------------- activity --}} @if ($tab === 'activity') @if ($activity->isEmpty()) @else
    @foreach ($activity as $entry)
  • {{ $entry->description }}

    {{ $entry->event }} · {{ $fmt->dateTime($entry->created_at) }} @if ($entry->ip_address) · {{ $entry->ip_address }} @endif

  • @endforeach
@endif
@endif {{-- ------------------------------------------------------------ modals --}} @include('livewire.tenants.partials.actions')