@extends('backend.layouts.app') @section('title', __('Project Updater')) @push('styles') @endpush @section('content') @php $licenseActive = $license?->isActive() ?? false; $latestStatus = $latest?->status ?? 'not_checked'; $changelog = collect($latest?->changelog ?? []); $supportTone = $license?->supportTone() ?? 'secondary'; $supportDaysRemaining = $license?->supportDaysRemaining(); $supportExpired = $license && $supportDaysRemaining !== null && $supportDaysRemaining < 0; $supportEndingSoon = $license?->supportExpiresSoon() ?? false; $showAlert = ! $license || $supportExpired || $supportEndingSoon; $alertTitle = ! $license ? __('Activate your ZilitPay license') : ($supportExpired ? __('Envato support has expired') : __('Envato support is ending soon')); $alertMessage = ! $license ? __('Enter the Envato purchase code to connect this installation with your private update server.') : ($supportExpired ? __('You can still receive ZilitPay project updates for free. Extend Envato support if you need priority help, setup assistance, or service support.') : __('Your support period is close to ending. Updates remain lifetime free, but extending support keeps premium help available when you need it.')); $latestVersion = $latest?->version; $hasUpdate = $latest && $latest->status === 'available'; $isCurrent = $latest && $latest->status === 'current'; $checksTotal = count($checks ?? []); $checksPassed = collect($checks ?? [])->where('status', true)->count(); $checksReady = $checksTotal > 0 && $checksPassed === $checksTotal; $licenseKpiTone = $licenseActive ? 'success' : ($license ? 'warning' : 'neutral'); $supportKpiTone = match ($supportTone) { 'success' => 'success', 'warning' => 'warning', 'danger' => 'danger', default => 'neutral', }; $releaseKpiTone = $hasUpdate ? 'info' : ($isCurrent ? 'success' : 'neutral'); $checksKpiTone = $checksReady ? 'success' : 'warning'; $supportRemainingLabel = $license ? ($supportExpired ? __(':days days ago', ['days' => abs((int) $supportDaysRemaining)]) : ($supportDaysRemaining !== null ? __(':days days left', ['days' => (int) $supportDaysRemaining]) : __('Unknown'))) : __('Not activated'); @endphp
{{-- Hero ---------------------------------------------------------- --}}

{{ __('Project Updater') }}

{{ __('Activate the ZilitPay license, check your private update server, verify packages, and install signed releases from one place.') }}

{{ __('Installed') }} v{{ config('app.version') }}
@csrf
{{-- KPI Strip ----------------------------------------------------- --}}
{{ __('License') }} {{ $licenseActive ? __('Active') : ($license ? __('Inactive') : __('Not Linked')) }} {{ $license ? ($license->domain ?: request()->getHost()) : __('Activate to enable updates') }}
{{ __('Support') }} {{ $license?->supportStatusLabel() ?? __('Unknown') }} {{ $supportRemainingLabel }}
{{ __('Latest Release') }} {{ $latestVersion ? 'v' . $latestVersion : __('Not checked') }} @if($hasUpdate) {{ __('Update available') }} @elseif($isCurrent) {{ __('You are up to date') }} @else {{ __('Run a check to discover releases') }} @endif
{{ __('Readiness') }} {{ $checksPassed }} / {{ $checksTotal }} {{ __('passing') }} {{ $checksReady ? __('Ready to install') : __('Resolve highlighted items') }}
{{-- Conditional alert (only when there's something to act on) ----- --}} @if($showAlert)
{{ $alertTitle }}

{{ $alertMessage }}

@endif {{-- License + Release -------------------------------------------- --}}

{{ __('License') }}

{{ __('Purchase verification stays on your private update server.') }}

{{ $licenseActive ? __('Active') : __('Inactive') }}
@if($license)
{{ __('Buyer') }} {{ $license->buyer_username ?: __('Unknown') }}
{{ __('Support Until') }} {{ $license->support_until?->format('M d, Y') ?? __('Unknown') }}
{{ __('Last Checked') }} {{ $license->last_checked_at?->diffForHumans() ?? __('Never') }}
{{ __('Update Access') }} {{ __('Lifetime Free') }}
@endif @can('project-updater-manage')
@csrf
@error('purchase_code')
{{ $message }}
@enderror
{{ __('Envato support period is for premium service, setup help, and priority assistance only.') }}
@endcan

{{ __('Release') }}

{{ __('Latest version returned by your update server.') }}

{{ title(str_replace('_', ' ', $latestStatus)) }}
{{ __('Current') }} v{{ config('app.version') }}
{{ __('Latest') }} {{ $latestVersion ? 'v' . $latestVersion : '—' }}
{{ __('Channel') }} {{ $latest?->channel ?? config('project_updater.channel') }}
{{ __('Released') }} {{ $latest?->release_date?->format('M d, Y') ?? __('Unknown') }}
@can('project-updater-manage')
{{ __('Important: download a local backup before updating') }} {{ __('Save the recovery ZIP on your computer before installing. If an update fails and no local backup was kept, restore may not be possible and support may be limited.') }}
@csrf
@endcan @if($hasUpdate) @can('project-updater-manage')
@csrf
{{ __('Before clicking Install Update, download and save the recovery ZIP locally. Without a local backup, crash recovery may be limited and complaints about missing backups cannot be accepted.') }}
@endcan @endif
{{-- Readiness + Changelog ---------------------------------------- --}}

{{ __('Readiness') }}

{{ __('Server-side checks required before package install.') }}

{{ $checksPassed }}/{{ $checksTotal }} {{ __('ready') }}
    @foreach($checks as $check)
  • {{ $check['label'] }} {{ $check['help'] }}
  • @endforeach

{{ __('Changelog') }}

{{ __('What this release changes.') }}

@if($changelog->isNotEmpty()) {{ trans_choice(':count entry|:count entries', $changelog->count(), ['count' => $changelog->count()]) }} @endif
@if($changelog->isNotEmpty())
    @foreach($changelog->take(8) as $index => $line)
  1. {{ $index + 1 }} {{ is_array($line) ? ($line['title'] ?? json_encode($line)) : $line }}
  2. @endforeach
@else @endif
{{-- History ------------------------------------------------------- --}}

{{ __('Update History') }}

{{ __('Recent checks, downloads, installs, and failures.') }}

@if($history->isNotEmpty()) {{ trans_choice(':count entry|:count entries', $history->count(), ['count' => $history->count()]) }} @endif
@if($history->isNotEmpty())
@foreach($history as $update) @endforeach
{{ __('Version') }} {{ __('Status') }} {{ __('Checked') }} {{ __('Installed') }} {{ __('Backup') }}
v{{ $update->version }} {{ title(str_replace('_', ' ', $update->status)) }} {{ $update->checked_at?->diffForHumans() ?? '—' }} {{ $update->installed_at?->diffForHumans() ?? '—' }} {{ $update->backup_path ?: '—' }}
@else @endif
@endsection