Maintenance

Kelola backup database dan optimasi performa aplikasi.

{{-- Flash: Optimize Results --}} @if(session('optimize_results'))

Hasil Proses

@foreach(session('optimize_results') as $result)
{{ $result['label'] }} @if($result['status'] === 'success') {{ $result['message'] }} @else {{ $result['message'] }} @endif
@endforeach
@endif {{-- Flash: Backup Success --}} @if(session('backup_success'))

Backup berhasil dibuat!

{{ session('backup_success') }}

Download
@endif
{{-- =============================== --}} {{-- SECTION 1: Backup & Download DB --}} {{-- =============================== --}}
{{-- Header --}}

Backup & Download Database

Buat snapshot database dan unduh file SQL

{{-- DB Info --}}

Database

{{ config('database.connections.mysql.database') }}

Host

{{ config('database.connections.mysql.host') }}:{{ config('database.connections.mysql.port', 3306) }}

Driver

{{ config('database.default') }}

Koneksi

Terhubung
{{-- Action --}}

Klik tombol di bawah untuk membuat file backup .sql. File akan dibuat di server, kemudian dapat diunduh.

@csrf
{{-- Existing Backup Files --}} @php $backupDir = storage_path('app/backups'); $backupFiles = []; if (is_dir($backupDir)) { $files = glob($backupDir . '/*.sql'); rsort($files); foreach (array_slice($files, 0, 5) as $f) { $backupFiles[] = [ 'name' => basename($f), 'size' => round(filesize($f) / 1024, 1) . ' KB', 'date' => date('d M Y, H:i', filemtime($f)), ]; } } @endphp @if(count($backupFiles) > 0)

File Backup Tersimpan

@foreach($backupFiles as $backup)

{{ $backup['name'] }}

{{ $backup['date'] }} • {{ $backup['size'] }}

Download
@endforeach
@else

Belum ada file backup tersimpan.

@endif
{{-- =============================== --}} {{-- SECTION 2: Optimize Script --}} {{-- =============================== --}}
{{-- Header --}}

Optimize Script

Cache config, route, dan view untuk performa optimal

{{-- Cache Status Cards --}}
@php $configCached = file_exists(base_path('bootstrap/cache/config.php')); $routeCached = file_exists(base_path('bootstrap/cache/routes-v7.php')) || file_exists(base_path('bootstrap/cache/routes.php')); $viewCached = count(glob(storage_path('framework/views/*.php'))) > 0; $envMode = app()->environment(); @endphp
Config

{{ $configCached ? 'Cached' : 'Not Cached' }}

Routes

{{ $routeCached ? 'Cached' : 'Not Cached' }}

Views

{{ $viewCached ? 'Compiled' : 'Not Cached' }}

Environment

{{ $envMode }}

{{-- Optimize Actions --}}
{{-- Optimize All --}}

Optimize Semua

Jalankan artisan optimize — cache config, route, dan view sekaligus.

@csrf
{{-- Clear Cache --}}

Clear Semua Cache

Jalankan artisan cache:clear, config:clear, view:clear.

@csrf
{{-- Info --}}

Gunakan Optimize di production dan Clear Cache saat development atau setelah perubahan konfigurasi.