@use('App\Models\License') @php /* | Requires in scope: $license, $packages. Owner-only — the caller gates it. | | Every form here is a plain POST to an existing route. The Alpine layer in | front (licenseShow) intercepts submit for a confirmation dialog and a busy | state; data-confirm-* carries the dialog copy, with {field} tokens | resolved from the form's own inputs at click time. */ $canSuspend = $license->status === License::STATUS_ACTIVE; $canReactivate = in_array($license->status, [License::STATUS_SUSPENDED, License::STATUS_PENDING], true); $isRevoked = $license->status === License::STATUS_REVOKED; $syncTone = match ($license->sync_status) { 'synced' => 'text-emerald-600 dark:text-emerald-400', 'failed' => 'text-red-600 dark:text-red-400', 'pending' => 'text-amber-600 dark:text-amber-400', default => 'text-slate-400 dark:text-slate-500', }; @endphp

Owner Actions

Manage this license and its permissions

{{-- ── Renew ───────────────────────────────────────────────── --}}
@csrf
{{-- ── Extend ──────────────────────────────────────────────── --}}
@csrf
{{-- ── Suspend / Reactivate / Revoke ───────────────────────── --}}
@if ($canSuspend)
@csrf
@elseif ($canReactivate) {{-- Bringing a licence back is the safe direction; no dialog. --}}
@csrf
@else Suspend @endif @if ($isRevoked) Revoked @else
@csrf
@endif
{{-- ── Instant sync ────────────────────────────────────────── --}} {{-- Status changes above already push automatically; this is the manual override for when an install looks out of step. --}} @if ($license->domain)
@csrf

Last sync: {{ ucfirst($license->sync_status ?? 'never') }} @if ($license->last_synced_at) · {{ $license->last_synced_at->diffForHumans() }} @endif

@else

Not bound to an installation yet — sync becomes available once the customer activates.

@endif
{{-- ── Back navigation ─────────────────────────────────────────────── --}} Back to licenses Return to all licenses list