{{-- ════════════════════════════════════════════════════════════════ CURRENT VERSION CARD Shows what's installed right now. The blade is invoked from /admin/update; UpdaterService::currentVersion() reads config/version.php. ════════════════════════════════════════════════════════════════ --}}

{{ __('Currently Installed') }}

v{{ $currentVersion }}

{{ __('Build') }} {{ $currentBuild }} · {{ config('version.name', config('app.name')) }}

{{-- ════════════════════════════════════════════════════════════════ 5-STEP WIZARD Each step submits to a controller endpoint that returns JSON. Steps lock in sequence — you can't run #4 before #3 succeeds. stepStatus tracks idle/running/done/error per step. ════════════════════════════════════════════════════════════════ --}}

{{ __('Update Process') }}

{{ __('Run each step in order. Your code is backed up first; database rows and uploaded files are preserved throughout.') }}

{{-- Step 1: Backup --}}
1

{{ __('Backup files & database') }}

{{ __('Creates a code ZIP and SQL dump in storage/app/backups so you can roll back if anything goes wrong.') }}

{{-- Step 2: Upload ZIP --}}
2

{{ __('Upload update ZIP') }}

{{ __('Pick the .zip you downloaded from your vendor. Version inside is verified before anything else.') }}

{{-- Step 3: Apply --}}
3

{{ __('Apply code update') }}

{{ __('Extracts the ZIP and overwrites code paths only. Your .env, storage/, vendor/, and uploaded media are skipped.') }}

{{-- Step 4: Migrate --}}
4

{{ __('Run database migrations') }}

{{ __('Adds new tables and columns from the update. Existing rows are NEVER deleted — Laravel only runs migrations not already recorded.') }}

{{-- Step 5: Finalize --}}
5

{{ __('Finalize & health check') }}

{{ __('Clears caches, verifies database/storage/.env, removes the staging ZIP.') }}

{{-- Health check results --}}
{{-- ════════════════════════════════════════════════════════════════ ROLLBACK CARD Lists every backup directory written by createBackup() so the admin can restore code + DB if an update went wrong. The path is path-traversal protected on the server side. ════════════════════════════════════════════════════════════════ --}} @if(count($backups) > 0)

{{ __('Rollback') }}

{{ __('Restore code and database to a previous backup if something went wrong with the latest update.') }}

@foreach($backups as $backup)

v{{ $backup['version'] ?? 'unknown' }}

{{ \Carbon\Carbon::parse($backup['created_at'] ?? now())->format('d M Y, H:i') }}

@endforeach
@endif
{{-- The admin layout does not flush a `@stack('scripts')`, so we inline the Alpine helper directly. Without this, x-data="updater()" binds to an undefined function and every x-show condition silently fails, producing empty buttons with no step labels. --}}