ludovicguenet / whizbang
Whizbang β Automatic database schema change tracking, risk analysis, and instant rollback for Laravel.
Requires
- php: ^8.2
- illuminate/console: ^10.0|^11.0|^12.0
- illuminate/database: ^10.0|^11.0|^12.0
- illuminate/support: ^10.0|^11.0|^12.0
Requires (Dev)
- laravel/pint: ^1.16
- nunomaduro/larastan: ^2.9
- orchestra/testbench: ^9.0|^10.0
- pestphp/pest: ^2.34
- pestphp/pest-plugin-laravel: ^2.4
- phpstan/phpstan: ^1.11
This package is auto-updated.
Last update: 2025-08-12 13:10:31 UTC
README

π‘οΈ Whizbang β Laravel Database Safety Package
The ONE thing Laravel is desperately missing that EVERY developer needs! Automatic database schema change tracking, safety analysis, and instant rollback system for Laravel migrations.
Installation β’ Quick Start β’ Features β’ Commands β’ Use Cases β’ Contributing
β οΈ Production Safety Tool: Whizbang is designed to protect live databases. Use it in development and production to prevent irreversible data loss.
π₯ The Problem
- You run
php artisan migrate
in production. - Migration drops a column with important data β GONE FOREVER.
- App breaks β NO EASY WAY BACK.
- Boss asks "What changed?" β Β―\(γ)/Β―
Laravel migrations are one-way by default. Once destructive changes happen, thereβs no built-in recovery or audit trail.
β The Solution: Whizbang
An automatic safety net for database changes that Laravel doesnβt provide.
β¨ Key Features
- πΈ Auto-Snapshots β Capture schema before every migration
- π‘οΈ Danger Detection β Warn about risky operations (DROP TABLE, DROP COLUMN, etc.)
- π Rollback Flow β Execute a rollback procedure with safety checks; table recreation steps are currently logged (scaffold), not auto-applied
- β‘ Risk Analysis β Calculate rollback safety before executing
- π Change Tracking β Complete audit trail of what changed and when
π¨ Real-World Example
php artisan migrate # πΈ Pre-migration snapshot saved (ID: 123) # β οΈ DANGEROUS CHANGES DETECTED! # β Column 'users.email' was dropped (Risk: HIGH) # π To rollback, use: php artisan schema:rollback 123
π Requirements
- PHP 8.2+
- Laravel 11.0+
- Database supported by Laravel Migrations
π¦ Installation
Install Package
composer require ludovicguenet/whizbang
Publish Config
php artisan vendor:publish --tag=whizbang-config
Run Migrations
php artisan migrate
π Quick Start
Manual Snapshot
php artisan schema:snapshot --reason="before-hotfix"
Risk Analysis
php artisan schema:status # Recent Snapshots: # ID | Reason | Created At | Tables # 123 | pre_migration | 2024-08-11 10:30:00 | 15 # 122 | manual | 2024-08-11 09:15:00 | 15
Rollback Flow
php artisan schema:rollback 123 # β οΈ You are about to rollback your database schema! # β Rollback safety check passed # Are you absolutely sure? (yes/no): yes # β Rollback flow executed. Table recreation steps were logged (no destructive actions applied automatically)
βοΈ Commands
# Take a snapshot php artisan schema:snapshot --reason="before-release" # Check status and history php artisan schema:status # Rollback to a snapshot php artisan schema:rollback 123 # Force rollback (skip safety checks) php artisan schema:rollback 123 --force
π― Use Cases
- Production Deployments β Auto-snapshot before migrations
- Hotfixes β Quick rollback when things go wrong
- Schema Auditing β Track all database changes
- Team Safety β Prevent dangerous operations
- Compliance β Maintain schema change history
β Why This Doesnβt Exist in Laravel
Laravel focuses on forward migrations, but offers no built-in way to:
- Track actual schema changes
- Analyze safety of those changes
- Rollback schema changes without full backups
- Warn about dangerous operations
Every Laravel developer has been burned by this. Whizbang closes that gap.
π€ Contributing
We welcome contributions!
git clone https://github.com/ludoguenet/whizbang.git
cd whizbang
composer install
vendor/bin/pest
π License
Whizbang is open-source software licensed under the MIT License.
π Security
If you discover security vulnerabilities, please email ludo@epekta.com instead of using the issue tracker.
π‘οΈ Made with β€οΈ by Ludovic GuΓ©net for the Laravel community π‘οΈ