A Laravel package to easily manage application updates through versioned update packages.
You can install the package via composer:
composer require infinitietechnologies/laravel-updraftAfter installing the package, publish the configuration file using:
php artisan vendor:publish --tag=laravel-updraft-configThis will create a laravel-updraft.php configuration file in your config directory.
You may also want to publish the migrations to customize them before running:
php artisan vendor:publish --tag=laravel-updraft-migrationsOr publish the views to customize the look and feel:
php artisan vendor:publish --tag=laravel-updraft-viewsThe published configuration file contains the following settings:
web_interface: Enable or disable the web interface for the updatermiddleware: The middleware to apply to the web routesupdate_path: The path where update packages will be storedbackup_path: The path where backups will be storedbackup_retention: The number of backups to keep (0 to keep all)layout: The blade layout to use for the updraft views (defaults to 'layouts.app')verify_updates: Enable or disable verification of update packagesupdate_public_key: The public key used to verify update packages
Update packages are ZIP files with the following structure:
update-package.zip/
├── files/ # Contains all new or modified files with their full path structure
├── migrations/ # New database migrations
├── config/ # Configuration files to update
├── manifests/ # Separate manifest files
│ ├── file-manifest.json # Lists all file changes
│ ├── migration-manifest.json # Lists migrations to run
│ ├── config-manifest.json # Lists config files to update
│ └── command-manifest.json # Lists commands to run after update
└── update-manifest.json # Main manifest with core metadata
{
"name": "Application Update",
"version": "1.2.0",
"description": "This update adds new features and fixes bugs",
"minimumRequiredVersion": "1.1.0",
"requiredPhpVersion": ">=8.1",
"requiredLaravelVersion": ">=10.0"
}{
"added": [
"app/Models/NewFeature.php",
"resources/views/new-feature/index.blade.php"
],
"modified": [
"app/Http/Controllers/ExistingController.php",
"resources/views/layouts/app.blade.php"
],
"deleted": [
"app/Models/DeprecatedModel.php"
]
}{
"migrations": [
"2025_05_08_000000_add_new_feature_table.php"
]
}{
"configFiles": [
"new-feature.php"
]
}{
"postUpdateCommands": [
"php artisan cache:clear",
"php artisan config:cache",
"php artisan view:cache"
]
}- Navigate to
/admin/updatesin your Laravel application - Upload the update package using the provided form
- The system will process the update and display the results
php artisan updraft:update path/to/update-package.zipor to skip confirmation:
php artisan updraft:update path/to/update-package.zip --forceIf you need to revert to a previous version, Laravel Updraft provides rollback functionality.
- Navigate to
/admin/updates/rollbackin your Laravel application - Select the version you want to roll back to
- Confirm the rollback operation
Alternatively, you can access the rollback options from the update history page.
php artisan updraft:rollbackThis will list available backups and prompt you to select one. Or specify a backup ID directly:
php artisan updraft:rollback {backupId}Use the --force option to skip confirmation:
php artisan updraft:rollback {backupId} --forceWhen an update is applied, the system performs the following steps:
- Extracts the update package
- Validates the package structure and manifests
- Checks version compatibility
- Creates a backup of files that will be modified or deleted
- Processes file changes (adds, modifies, and deletes files)
- Runs any new migrations
- Updates configuration files
- Runs post-update commands
If the update fails at any step, the system will attempt to restore from backup.
When rolling back to a previous version, the system performs these steps:
- Creates a safety backup of the current state
- Restores files from the selected backup
- Updates the application history to record the rollback
Note: Database changes cannot be automatically reverted during rollback. Make sure you have a database backup if needed.
Laravel Updraft views use a layout file that can be configured in the laravel-updraft.php config file:
'layout' => 'layouts.app',Change this to use your own layout file. For further customization, publish the views:
php artisan vendor:publish --tag=laravel-updraft-views- Simple Update Process: Streamlined workflow for applying updates to your Laravel application
- Version Control: Ensures that updates are only applied to compatible application versions
- Automatic Backups: Creates backups before applying updates for safe rollbacks
- Rollback Capability: Revert to previous versions when needed
- Web Interface: User-friendly interface for uploading, applying, and rolling back updates
- Command Line Support: Apply updates and rollbacks via Artisan commands for automated deployment
- Flexible Manifest System: Detailed manifests for controlling update behavior
- Customizable UI: Configure the layout and publish views to match your application's design
- Security First: Package verification and authentication built-in
- All update operations require authentication and authorization
- Update packages can be verified with a digital signature
- Backups are created before any changes are applied
- Safety backups are created before rollbacks
Contributions are welcome! Please feel free to submit a Pull Request.
This package is open-sourced software licensed under the MIT license.