{{-- resources/views/panel/applications.blade.php --}} {{-- ✅ Global Alpine state for the delete modal --}}

Applications

Create and manage your apps. Each app has its own key and license rules.
@php $canCreate = ($settings?->can_create_apps) === true; // NULL = unlimited $limitText = ($appsLimit === null) ? '∞' : (string) $appsLimit; $limitReached = ($appsLimit !== null) && ((int)$activeCount >= (int)$appsLimit); $disabledCreate = (!$canCreate) || $limitReached; $disabledReason = ''; if (!$canCreate) $disabledReason = 'Your account is pending approval.'; elseif ($limitReached) $disabledReason = 'You have reached your app limit.'; @endphp
{{-- Trash --}} @if(!empty($trashCount) && $trashCount > 0) {{ $trashCount }} @endif {{-- Create form --}}
@csrf
@if($disabledCreate && $disabledReason)
{{ $disabledReason }}
@else
Tip: Use a short name (e.g., “My Desktop App”).
@endif
{{-- Usage / limit --}}
Apps: {{ (int)$activeCount }} / {{ $limitText }}
@if($limitReached)
You have reached your app limit. Delete an app or contact support to increase your limit.
@endif
{{-- Errors --}} @if ($errors->any())
{{ $errors->first() }}
@endif {{-- Pending approval notice --}} @if(($settings?->can_create_apps) !== true)
You can view this section, but your account is not approved to create apps yet.
@endif {{-- List --}}
@if($apps->isEmpty())
No applications yet
Create your first app to start issuing licenses and validating clients.
@else
@foreach($apps as $app) @php $status = (string) ($app->status ?? 'active'); $statusClasses = match ($status) { 'active' => 'bg-green-50 text-green-700 dark:bg-green-900/20 dark:text-green-200 ring-1 ring-inset ring-green-200 dark:ring-green-700/50', 'maintenance' => 'bg-yellow-50 text-yellow-800 dark:bg-yellow-900/20 dark:text-yellow-100 ring-1 ring-inset ring-yellow-200 dark:ring-yellow-700/50', 'suspended' => 'bg-red-50 text-red-700 dark:bg-red-900/20 dark:text-red-200 ring-1 ring-inset ring-red-200 dark:ring-red-700/50', default => 'bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-200 ring-1 ring-inset ring-gray-200 dark:ring-gray-700/50', }; // ✅ Correct field (your model uses "key") $appKey = (string) ($app->key ?? ''); @endphp {{-- App Key + copy --}} @endforeach
Name Licenses App Key Status Version Actions
{{ $app->name }}
Created: {{ optional($app->created_at)->format('Y-m-d') ?? '-' }}
{{ (int) $app->active_licenses_count }} @if($appKey !== '')
{{ $appKey }}
@else @endif
{{ ucfirst($status) }} {{ $app->current_version ?? '-' }}
Manage
Tip: Use the Trash to restore apps within 24 hours.
@endif
{{-- ✅ PRO modal --}} {{-- ✅ Alpine helper --}}