PHP code example of backpack / backupmanager

1. Go to this page and download the library: Download backpack/backupmanager 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/ */

    

backpack / backupmanager example snippets


// app/Console/Kernel.php

protected function schedule(Schedule $schedule)
{
    // if you are not using notifications you should add the `--disable-notifications` flag to this commands
    $schedule->command('backup:clean')->daily()->at('04:00');
    $schedule->command('backup:run')->daily()->at('05:00');
}

'mysql' => [
    'driver'            => 'mysql',
    'host'              => env('DB_HOST', 'localhost'),
    'database'          => env('DB_DATABASE', 'forge'),
    'username'          => env('DB_USERNAME', 'forge'),
    'password'          => env('DB_PASSWORD', ''),
    'charset'           => 'utf8',
    'collation'         => 'utf8_unicode_ci',
    'prefix'            => '',
    'strict'            => false,
    'engine'            => null,
    'dump' => [

        'dump_binary_path' => '/path/to/directory/', // only the path, without `mysqldump` or `pg_dump`
        // 'dump_binary_path' => '/Applications/MAMP/Library/bin/', // works for MAMP on Mac OS
        // 'dump_binary_path' => '/opt/homebrew/bin/', // works for Laravel Valet on Mac OS
        'use_single_transaction',
        'timeout' => 60 * 5, // 5 minute timeout
        // 'exclude_tables' => ['table1', 'table2'],
        // 'add_extra_option' => '--optionname=optionvalue',
    ]
],
 bash
# Install the package
composer ager configs and lang files:
php artisan vendor:publish --provider="Backpack\BackupManager\BackupManagerServiceProvider" --tag=backup-config --tag=lang

# [optional] Add a menu item for it
# For Backpack v6
php artisan backpack:add-menu-content "<x-backpack::menu-item title='Backups' icon='la la-hdd-o' :link=\"backpack_url('backup')\" />"
# For Backpack v5 or v4
php artisan backpack:add-sidebar-content "<li class='nav-item'><a class='nav-link' href='{{ backpack_url('backup') }}'><i class='nav-icon la la-hdd-o'></i> Backups</a></li>"
routes/backpack/backupmanager.php