PHP code example of fomvasss / laravel-backup-ui

1. Go to this page and download the library: Download fomvasss/laravel-backup-ui 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/ */

    

fomvasss / laravel-backup-ui example snippets


return [
    // Route prefix for the backup UI
    'route_prefix' => 'backup',
    
    // Middleware to apply to routes
    'middleware' => ['web', 'auth'],
    
    // Page title
    'page_title' => 'Backup Management',
    
    // Specific users allowed to access (empty = all authenticated users)
    'allowed_users' => [
        // '[email protected]'
    ],
    
    // Custom authorization callback
    'auth_callback' => null,
    
    // Queue configuration for async backup creation
    'queue' => [
        // Enable queue processing (set to false for synchronous backups)
        'enabled' => false,
        
        // Queue name (leave null to use default queue)
        'name' => null,
    ],
];

'queue' => [
    'enabled' => true,
    'name' => 'backups',
],

'environments' => [
    'production' => [
        'backups' => [
            'connection' => 'redis',
            'queue' => ['backups'],
            'balance' => 'simple',
            'processes' => 1,
            'timeout' => 3600, // large backups/restores can take a while
            'tries' => 2,
        ],
    ],
],

// config/backup-ui.php
'auth_callback' => function () {
    return auth()->check() && auth()->user()->hasRole('admin');
},

// config/backup-ui.php
'allowed_users' => [
    '[email protected]',
    '[email protected]',
],
bash
php artisan vendor:publish --tag=backup-ui-config
bash
php artisan vendor:publish --tag=backup-ui-views
bash
php artisan vendor:publish --tag=backup-ui-views