spatie/laravel-backup
Back up your Laravel app to any configured filesystem. Creates zip archives of selected files plus database dumps, supports multiple destinations, health monitoring, notifications, and automated cleanup of old backups via simple Artisan commands.
Pros:
schedule:run). Aligns seamlessly with Laravel’s ecosystem (e.g., queues, notifications, and config management).backup.php config, allowing alignment with existing infrastructure (e.g., multi-cloud backups).spatie/db-dumper for flexibility.Cons:
ZipArchive and database drivers, which may introduce compatibility risks with non-standard PHP setups (e.g., custom extensions).spatie/laravel-medialibrary or similar).Laravel Stack Fit:
backup:run, backup:monitor) integrates with Laravel’s task runners (e.g., queue:work).Backup::create()->run()), enabling async execution and retries.Schedule::command('backup:run')->daily()).Non-Laravel Systems:
spatie/laravel-redis-backup).High:
verify_backup: true and retry logic.backup:monitor and adjust temporary_directory or compression_level.vendor/ (including spatie/db-dumper). Justify with backup criticality.Medium:
include/exclude rules to avoid backing up unnecessary files (e.g., node_modules, vendor).continue_on_failure: true cautiously.Low:
Backup Scope:
Retention Policy:
Recovery Process:
Monitoring and Alerts:
Security:
.env; consider secrets managers (e.g., AWS Secrets Manager) for production.Scaling:
useSingleTransaction: true for MySQL and adjust temporary_directory to a high-I/O disk.Cost:
CM_XZ) reduces size but increases CPU usage.Laravel-Centric:
app/Console/Kernel.php:
protected function schedule(Schedule $schedule): void
{
$schedule->command('backup:run')->daily()->at('02:00');
}
Backup::create()->run(); // Runs in queue
Backup::create()
->onFailure(function (BackupFailed $event) {
Notification::route('slack', 'team-channel')
->notify(new BackupFailedNotification($event));
})
->run();
Non-Laravel Extensions:
spatie/db-dumper directly if not using Laravel.league/flysystem for custom storage backends.Pilot Phase:
storage/app, database).backup:monitor to check for health issues.Production Rollout:
production) first.mysqldump + tar) to compare outputs.Deprecation Plan:
laravel-backup-generator), run both in parallel for 2–3 backup cycles to verify consistency.Laravel Versions:
Database Drivers:
spatie/db-dumper).Storage Backends:
continue_on_failure: true for resilience.Third-Party Integrations:
How can I help you explore Laravel packages today?