Laravel Backup v10: Serialisable Events and Resilient Multi-Destination Backups
Spatie has released v10 of laravel-backup, one of the most widely used backup packages in the Laravel ecosystem. The update addresses several long-standing community requests, fixes a couple of meaningful bugs, and cleans up the internals. It is a breaking change release, but the migration is straightforward for most applications.
Serialisable events
The most significant change in v10 is that all backup events now carry primitive data rather than objects. Previously, events such as BackupWasSuccessful passed a BackupDestination object, which is not serialisable. This made it impossible to use queued listeners with backup events - a common pattern for sending notifications or triggering follow-on jobs asynchronously.
In v10, events carry string $diskName and string $backupName instead. Queued listeners now work as expected. The trade-off is a breaking change: any existing listeners that reference $event->backupDestination->diskName() will need updating to $event->diskName.
Events and notifications decoupled
A related bug is also fixed in v10. Previously, running backup:run --disable-notifications silently suppressed events as well as notifications, which meant BackupWasSuccessful never fired. This also broke encryption, which depends on the BackupZipWasCreated event to function correctly.
Events now always fire regardless of the --disable-notifications flag. Notifications and events are independent concerns and are now treated as such.
Resilient multi-destination backups
A new continue_on_failure configuration option controls behaviour when backing up to multiple disks. Previously, a failure on one destination would abort the entire backup run. With continue_on_failure enabled, a failed destination fires its failure event and the backup continues to the remaining destinations. For applications that back up to both a primary and a secondary offsite disk, this ensures a failure on one does not prevent the other from completing.
Other additions
- verify_backup - a new config option that validates the zip archive after creation, catching corrupt backups before they are stored.
- Webhook notification channel - a generic webhook channel for sending backup notifications to Mattermost, Microsoft Teams, or any custom endpoint, without needing a third-party package.
- New command options -
--filename-suffix,--exclude, and--destination-pathadd flexibility to thebackup:runcommand for teams with non-standard requirements. - Improved health checks - the monitor now reports all detected failures in a single pass rather than stopping at the first one, giving a complete picture of backup health in one run.
- storage/framework excluded by default - the framework cache directory is now excluded from file backups by default, reducing backup size without any configuration change.
Upgrading
The primary breaking change is the event signature update. Any listener referencing $event->backupDestination will need to be updated to use the new primitive properties. The full migration guide is in the package's UPGRADING.md.
If you are not already running automated backups on your Laravel applications, v10 is a good prompt to set it up. The package takes roughly ten minutes to configure and gives you scheduled database and file backups to any Laravel-supported filesystem - S3, SFTP, local storage, or multiple destinations at once.
