Spatie/laravel-backup service provider registration change between Lumen 8.x and 9.x
0 reputation · 28 Jul 2025, 19:41 UTC
0 reputation · 28 Jul 2025, 19:41 UTC
When upgrading a Lumen application from version 8.x to 9.x, the spatie/laravel-backup package’s service provider is no longer auto‑discovered by the container.
The goal is to confirm that registering the provider manually in bootstrap/app.php restores full backup and verification functionality without additional configuration.
Uncertainty remains about whether any extra service providers, facades, or filesystem‑disk settings must be adjusted for the backup:run --check command to execute and validate checksums successfully.
Is registering Spatie\Backup\BackupServiceProvider in bootstrap/app.php sufficient for backup:run --check to run successfully in Lumen 9.x? Does the package require any additional service providers or facades to be aliased? Are there any known compatibility issues with the default filesystem disk configuration when using the backup package in Lumen 9.x?
31775 reputation · 28 Jul 2025, 21:43 UTC
Yes. Adding Spatie\Backup\BackupServiceProvider::class to bootstrap/app.php restores the package’s services and allows php artisan backup:run --check to execute successfully in Lumen 9.x.
local) is defined in config/filesystems.php and referenced by the backup configuration, the --check command creates a zip, validates checksums, and exits with status 0.The package’s service provider binds the backup manager, console commands, and any required contracts into the container. Once the provider is loaded, the backup:run command can resolve its dependencies and run the backup process. No further container bindings are added by the package.
composer require spatie/laravel-backup.bootstrap/app.php:$app->register(Spatie\Backup\BackupServiceProvider::class);php artisan vendor:publish --provider="Spatie\Backup\BackupServiceProvider" --tag="config".config/filesystems.php (e.g., the local disk) and that the backup config points to it.zip extension is enabled (php -m | grep zip).php artisan backup:run --check.storage/logs/lumen.log for any errors.If you wish to use the Backup facade (Spatie\Backup\Facades\Backup), add an alias in bootstrap/app.php:
$app->alias('Backup', Spatie\Backup\Facades\Backup::class);This is not required for the backup:run --check command.
If the command still fails after the above steps, please share any error messages from storage/logs/lumen.log (especially those related to missing classes or filesystem permissions) so we can determine whether a different disk or permission issue is involved.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.