spatie/laravel-db-snapshots
Laravel package that adds Artisan commands to quickly create, load, list, and clean up database snapshots (dumps) for your app. Works with MySQL, PostgreSQL, and SQLite—ideal for resetting state in development or tests.
mysqldump, pg_dump), saving engineering time and reducing technical debt.Adopt if:
mysqldump/pg_dump is cumbersome.Look elsewhere if:
"This package lets our engineering team save and restore database states in seconds—like hitting ‘undo’ for our entire database. For example, if a developer breaks a migration or needs to test a complex query with production-like data, they can snapshot the current state, make changes, and revert instantly. This cuts debugging time by 30–50% and reduces the risk of environment drift in CI/CD. It’s a low-cost, high-impact tool that aligns with our goals for faster iteration and reliable deployments."
ROI:
*"This is a Swiss Army knife for database management in Laravel. Key benefits:
php artisan snapshot:create prod-like-data).users) or include only critical ones (e.g., orders, products).Example workflow:
snapshot:create buggy-state.snapshot:load buggy-state --connection=staging.snapshot:cleanup --keep=5.Alternatives considered:
mysqldump is error-prone and slow.Next steps:
composer.json and configure the snapshots disk.feature-x-prod-2024-05-20).How can I help you explore Laravel packages today?