@php
// Computed once per row from the already-loaded relations, so a wide grid
// does not turn into a query per column.
$status = $customer->licenseStatus();
$expiry = $customer->expiresAt();
$lastSeen = $customer->lastVerificationAt();
$current = $customer->currentLicense();
$domain = $customer->domains->first()?->domain;
$revenue = $customer->revenue();
@endphp
{{-- data-id is what "select all on this page" reads, so selection stays scoped
to the rows actually shown rather than to every id ever loaded. --}}
id }})"
aria-label="Select {{ $customer->company_name }}">
{{-- Company: identity in one cell — logo, name, and the domain it runs on. --}}
{{-- Contact: a person, with their own initials so the eye separates them
from the company in the cell to the left. --}}
id }}, @js($customer->company_name))">
View profile
Edit
{{-- Domains and licences are filtered to this customer rather than
dropping the user on an unfiltered list to find them again. --}}
Domains
Licences
@if ($current)
{{-- Each licence action is its own form: they are POSTs that change
state on a live installation, so none of them can be a link. --}}
@if ($current->status === \App\Models\License::STATUS_ACTIVE)
@elseif ($current->status === \App\Models\License::STATUS_SUSPENDED)
@else
Activate
@endif
@else
RenewSuspend
@endif