PHP code example of prodhan / laravel-backup-google-drive
1. Go to this page and download the library: Download prodhan/laravel-backup-google-drive 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/ */
prodhan / laravel-backup-google-drive example snippets
'destination' => [
'disks' => [
'google', // Add 'google' to your backup disks
],
],
'backup' => [
'name' => env('BACKUP_NAME', ''), // Empty string to save directly in folder
// ... other config
],
protected function schedule(Schedule $schedule): void
{
// Database backup daily at 1 AM
$schedule->command('backup:run --only-db')->daily()->at('01:00');
// Uploads backup daily at 2 AM
$schedule->command('backup:uploads')->daily()->at('02:00');
// Cleanup old backups daily at 3 AM
$schedule->command('backup:clean')->daily()->at('03:00');
$schedule->command('backup:clean-uploads --days=7')->daily()->at('03:00');
}