@extends('admin.layouts.app') @section('title', 'Backup & Firmware Upgrades - Dham Seva') @section('content')
{{-- Breadcrumb & Title Bar --}}
Dashboard / Settings / Backup & Firmware Updates

Backup, Restore & Firmware Patching Online • v{{ ltrim($versionData['current'], 'v') }}

Enterprise-grade complete database & media snapshots, firmware patch builder, safe upgrade pipeline, and automated service reload.

{{-- ═══ SYSTEM TELEMETRY & STATUS CARDS ═══ --}}
System Version
v{{ ltrim($versionData['current'], 'v') }}
{{ $versionData['codename'] }}
PHP Runtime
{{ explode('-', $telemetry['php_version'])[0] }}
Memory: {{ $telemetry['memory_limit'] }}
Laravel Core
v{{ $telemetry['laravel_version'] }}
{{ $telemetry['db_driver'] }} DB Connected
OPcache Bytecode
@if(str_contains($telemetry['opcache_status'], 'Active')) Active @else CLI Mode @endif
RAM Cache Engine
Total Backups
{{ count($backups) }}
Saved Snapshots
Max Upload
{{ $telemetry['upload_max_filesize'] }}
Exec: {{ $telemetry['max_execution_time'] }}
{{-- ═══ 2 MAIN WORKSPACE GRIDS: BACKUP/RESTORE + FIRMWARE PATCH ═══ --}}
{{-- 📦 CARD 1: COMPLETE SYSTEM BACKUP & RESTORE --}}
💾

Full System Snapshot

Database SQL + Public Storage Media + System Manifest

{{-- Action Area --}}

✓ Exports all database tables & schemas.
✓ Bundles user media uploads from storage/app/public.

{{-- Upload Restore Box --}}
Restore from Backup Archive (.zip) Safe Rebuild

Upload a previously generated backup zip to completely restore database & media files.

{{-- Existing Backups Quick Table --}}
Recent Stored Snapshots Stored in storage/app/backups/
@if(empty($backups))
No backup archives generated yet. Click "Take Backup" above to create your first snapshot.
@else
@foreach($backups as $b)
{{ $b['name'] }}
{{ $b['created_at'] }} • {{ $b['size'] }}
@endforeach
@endif
{{-- 🚀 CARD 2: FIRMWARE UPGRADATION PATCH SYSTEM --}}
⚙️

Firmware & Upgrade Patches

Automated Rollback Protection • Zero-Downtime Pipeline

{{-- Patch Upload Dropzone --}}

Upload Firmware Patch (.patch.zip)

Select an official release patch bundle. The system will auto-verify sha256 checksums, take an automated pre-patch safety snapshot, apply files, run DB migrations, and softly reload services.

{{-- Safety Highlights Box --}}
🛡️ Auto-Snapshot
Automatic safety backup is created right before any file is touched.
↩️ Fail-Safe Rollback
If migration fails, system auto-reverts to pre-patch state instantly.
{{-- Patch Creator CTA --}}
Need to distribute an update?
Generate a new firmware patch with version manifest.
{{-- ═══ CARD: BACKUP AUTOMATION, RETENTION RULES & ALERTS ═══ --}}
⚙️

Backup Automation, Retention Rules & Alerts

Configure auto-deletion rules (keep last N snapshots), scheduled cron frequencies, and instant notifications.

Current Rule: Keep Last {{ $backupSettings['retention_count'] }} Backups
{{-- 1. Retention Policy (Keep Last N Backups) --}}
Auto-Prune
snapshots stored

Default: 10. When total backups exceed this limit, older snapshots are automatically pruned from disk to protect server storage.

{{-- 2. Automated Scheduled Backup Frequency --}}
Scheduler

Runs automatically via Laravel scheduler (system:backup --scheduled) with zero human intervention.

{{-- 3. Instant Alerts (WhatsApp & Email) --}}
Instant Ping
{{-- WhatsApp Toggle --}}
{{-- Email Toggle --}}
Changing retention number immediately prunes any older excess backups automatically.
{{-- ═══ CARD 3: AUDIT & HISTORY LEDGER ═══ --}}
📜

System Updates & Reboot Audit Trail

{{ count($auditLogs) }} logged records
@forelse($auditLogs as $log) @empty @endforelse
Type Event / Operation Name Target Version Executed By Size / Checksum Timestamp Status
@if($log->type === 'backup') BACKUP @elseif($log->type === 'restore') RESTORE @elseif($log->type === 'patch') PATCH @else REBOOT @endif
{{ $log->name }}
@if($log->notes)
{{ $log->notes }}
@endif
{{ $log->version ?: '—' }} {{ $log->user?->name ?? 'System Automated' }} @if($log->size_bytes)
{{ $log->formatted_size }}
@endif @if($log->checksum)
{{ substr($log->checksum, 0, 16) }}...
@endif
{{ $log->created_at->format('d M Y, h:i A') }} @if($log->status === 'completed') Success @elseif($log->status === 'failed') Failed @else {{ ucfirst($log->status) }} @endif
No update audit records yet.
{{-- ═══ MODAL 1: BUILD NEW FIRMWARE PATCH MODAL ═══ --}}
📦

Build Firmware Patch Package

💡 Pro-Tip: Enter specific files or whole folders like database/migrations to automatically package all new tables & alter column scripts!

{{-- ═══ ⭐ MODAL 2: HIGH-TECH SYSTEM REBOOT OVERLAY WITH LIVE COUNTDOWN TIMER ⭐ ═══ --}}
{{-- Glowing Background Aura --}}
{{-- Top Icon (Animated Gear / Checkmark) --}}
{{-- Title & Status --}}

{{-- ⭐ BIG DIGITAL COUNTDOWN TIMER ⭐ --}}
{{-- Visual Checklist Pipeline --}}
Safety Maintenance Lock Engaged
Database Schemas & Migrations
PHP OPcache & RAM Bytecodes Flushed
Application Caches Recompiled
Background Queue Workers Reloaded

Please do not close your browser tab while services are reloading.

{{-- Alpine.js State Management --}} @endsection