PHP code example of klytron / laravel-backup-complete-restore

1. Go to this page and download the library: Download klytron/laravel-backup-complete-restore library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

klytron / laravel-backup-complete-restore example snippets


// config/backup-complete-restore.php
return [
    'file_mappings' => [
        'var/www/html/storage/app/public' => storage_path('app/public'),
        'var/www/html/public' => public_path(),
        'var/www/html/app' => base_path('app'),
    ],
    
    'health_checks' => [
        \Klytron\LaravelBackupCompleteRestore\HealthChecks\Checks\DatabaseHasTables::class,
        \Klytron\LaravelBackupCompleteRestore\HealthChecks\Checks\FilesExist::class => [
            'files' => [
                storage_path('app/public'),
                storage_path('logs'),
            ],
        ],
    ],
];
bash
# List available backups
php artisan backup:restore-complete --list

# Restore complete backup (interactive)
php artisan backup:restore-complete

# Restore specific backup
php artisan backup:restore-complete --backup="2024-01-15-10-30-00.zip"

# Restore database only
php artisan backup:restore-complete --database-only

# Restore files only
php artisan backup:restore-complete --files-only
bash
php artisan vendor:publish --provider="Klytron\LaravelBackupCompleteRestore\BackupCompleteRestoreServiceProvider"