CLI Commands - SameOldNick/laravel-backup-manager GitHub Wiki
backup-manager:install
Scaffolds stack-specific responder classes and a service provider into the host application so each app owns its UI implementation.
php artisan backup-manager:install --stack=inertia
Options
| Option | Description |
|---|---|
--stack= |
Required. Responder stack preset: inertia or custom. If not provided, you will be prompted interactively. |
--path= |
Destination directory for generated classes. Defaults to app/BackupManager. Accepts paths relative to base_path() or absolute paths. |
--app-namespace= |
Root namespace for generated classes. Defaults to the application's namespace (e.g. App\). |
--force |
Overwrite existing files without prompting. |
--skip-provider |
Skip generating App\Providers\BackupManagerServiceProvider. Use this if you already have one or want to bind interfaces manually. |
--skip-registration |
Skip auto-registering the provider in bootstrap/providers.php. You will need to register it manually. |
What It Generates
The command copies stub files from the package's resources/stubs/ directory into your application, applying namespace transformations.
Inertia Stack (--stack=inertia)
Generates Inertia.js responder classes that return page-level props:
| File | Purpose |
|---|---|
Responders/BackupDestinationsUiResponder.php |
List, create, edit, test, and delete storage destinations |
Responders/BackupSchedulesUiResponder.php |
Manage backup schedules |
Responders/BackupsUiResponder.php |
List and download backups |
Responders/PerformBackupUiResponder.php |
Initialize and monitor backup runs |
Responders/CleanupSchedulesUiResponder.php |
Manage cleanup schedules |
Responders/SchedulesUiResponder.php |
View all schedules |
Custom Stack (--stack=custom)
Generates stub responder classes with empty method bodies for you to implement.
Service Provider
Unless --skip-provider is used, generates App\Providers\BackupManagerServiceProvider that binds each responder contract to its implementation.
Namespace Transformation
All stub files use the placeholder namespace VendorName\. During scaffolding, this is replaced with your application's namespace (or the value of --app-namespace).
// Stub
namespace VendorName\BackupManager\Responders;
// After scaffolding (default)
namespace App\BackupManager\Responders;
// After scaffolding with --app-namespace=Acme\Blog
namespace Acme\Blog\BackupManager\Responders;
Bootstrap Registration
By default, the command appends App\Providers\BackupManagerServiceProvider::class to bootstrap/providers.php. It will not duplicate an existing entry. Use --skip-registration to disable this behavior.
Example: Custom Path
php artisan backup-manager:install --stack=inertia --path=app/Http/BackupManager
Example: Non-Interactive
php artisan backup-manager:install --stack=inertia --force --no-interaction