@extends('layouts.admin')
@section('title', 'Licenses')
@section('heading', 'Licenses')
@section('subheading', 'Manage and monitor all software licenses.')
@php
$canManage = auth()->user()?->isOwner() ?? false;
$expiringDays = (int) config('licensing.expiring_soon_days', 30);
// The controller supports exactly two server-side filters. Everything the
// toolbar offers beyond these refines the rows already on screen, and the
// footer says so whenever it is doing that.
$activeStatus = request('status');
$search = request('q');
$isFiltered = filled($activeStatus) || filled($search);
// Package options come from the rows on this page, not a fresh query: the
// filter is client-side, so offering packages that cannot match anything
// visible would just be a list of dead ends.
$packageNames = $licenses->pluck('package.name')->filter()->unique()->sort()->values();
// Quick filters that the server can actually honour. Each one is a link, so
// it covers the whole database and survives a bookmark.
$chips = [
['label' => 'All licenses', 'params' => [], 'icon' => 'layers'],
['label' => 'Active', 'params' => ['status' => 'active'], 'icon' => 'check-circle'],
['label' => 'Expiring soon', 'params' => ['status' => 'active', 'refine' => 'expiring'], 'icon' => 'clock'],
['label' => 'Expired', 'params' => ['status' => 'expired'], 'icon' => 'x-circle'],
['label' => 'Suspended', 'params' => ['status' => 'suspended'], 'icon' => 'pause'],
];
$currentChip = fn (array $params) =>
($params['status'] ?? null) === ($activeStatus ?: null)
&& ($params['refine'] ?? null) === (request('refine') ?: null);
@endphp
@section('header-actions')
@if ($canManage)
| {{-- indeterminate exists only as a DOM property, so it has to be assigned rather than bound as an attribute. --}} | License Key | Customer | Domain | Package | Status | Created | Expires | Actions |
|---|
Nothing on this page matches
The refinement hid all rows here. Clear it, or search instead — search covers every license.
Showing {{ number_format($licenses->firstItem()) }}–{{ number_format($licenses->lastItem()) }} of {{ number_format($licenses->total()) }} {{ Str::plural('license', $licenses->total()) }} {{-- Said out loud rather than left to be discovered: the refinement is not a search of the whole database. --}} · of shown on this page