PHP code example of wladmonax / laravel-db-backup

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

    

wladmonax / laravel-db-backup example snippets


'providers' => array(
    'Witty\LaravelDbBackup\DBBackupServiceProvider'
)

'providers' => array(
    Witty\LaravelDbBackup\DBBackupServiceProvider::class
)

return [

    // add a backup folder in the app/database/ or your dump folder
    'path' => app_path() . '/database/backup/',

    // add the path to the restore and backup command of mysql
    // this exemple is if your are using MAMP server on a mac
    // on windows: 'C:\\...\\mysql\\bin\\'
    // on linux: '/usr/bin/'
    // trailing slash is cret' => DROPBOX_APP_SECRET,
        'prefix' => DROPBOX_PREFIX, //this is name of your dropbox folder
    ],
    
    //encrypt settings
    'encrypt' => [
        'key' => ENCRYPT_KEY
    ],
    // Use GZIP compression
    'compress' => false,
];

sh
$ php artisan migrate

php artisan vendor:publish
sh
$ php artisan db:backup
sh
$ php artisan db:restore dump.sql
sh
$ php artisan db:restore --last-dump
sh
$ php artisan db:restore --dropbox-last-dump
sh
$ php artisan db:restore