PHP code example of marekmiklusek / database-backup

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

    

marekmiklusek / database-backup example snippets


// config/database-backup.php
'cleanup' => [
   'automatic' => false,
],

'google' => [  // Can be renamed to your preferred disk name
    'driver' => 'google',
    'client_id' => env('GOOGLE_CLIENT_ID'),
    'client_secret' => env('GOOGLE_CLIENT_SECRET'),
    'refresh_token' => env('GOOGLE_REFRESH_TOKEN'),
    'folder_id' => env('GOOGLE_FOLDER_ID'),
]
bash
php artisan vendor:publish --tag=database-backup-config
bash
php artisan db-backup:run
bash
php artisan db-backup:cleanup