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
'storage' => [
'disk' => 'local', // 'local' or your Google Drive disk name
'google_disk' => 'google', // which filesystems disk holds the Drive credentials
'use_both_disks' => false, // keep a local copy and upload to Drive
'directory' => 'database-backups',
'filename' => [
'prefix' => env('DB_DATABASE', 'laravel'),
'date_format' => 'Y-m-d_H-i-s',
],
],
'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'),
]