spatie/laravel-db-snapshots
Artisan commands to quickly create, load, list, and clean up database snapshots in Laravel. Dump and restore MySQL, PostgreSQL, and SQLite databases with named or latest snapshots—ideal for local/dev workflows and fast resets.
spatie/laravel-backup or native tools like pg_dump/mysqldump).--stream flag or external tools).For Executives: "This package lets our engineering team instantly save and restore the entire database state with a single command—like a ‘Ctrl+Z’ for our production data. For example, if a feature rollout goes wrong, we can revert to a pre-deployment snapshot in minutes, reducing downtime and customer impact. It also standardizes our development environments, cutting onboarding time by 30% (based on similar tools at [Company X]). The cost? Zero—it’s open-source and maintained by a trusted vendor (Spatie)."
For Engineering:
*"Leverage spatie/laravel-db-snapshots to:
snapshot:load.mysqldump scripts with a Laravel-native solution that handles compression, streaming, and cleanup automatically.
Trade-offs: Snapshots are full-database copies (not incremental), so use --table to limit scope. For large databases, use --stream to avoid memory issues. Example workflow:# Before testing a feature:
php artisan snapshot:create pre-feature-test --table=users,orders
# After changes:
php artisan snapshot:load pre-feature-test --stream
```*
**For QA/DevOps**:
*"This tool integrates with our existing Laravel ecosystem to:
- **Automate test data setup**: Load snapshots in pre-test hooks to ensure consistent datasets.
- **Validate migrations**: Compare snapshots before/after schema changes to catch unintended data loss.
- **Audit changes**: Track database state evolution over time via `snapshot:list`.
**Security note**: Store snapshots in encrypted storage (e.g., S3 with KMS) and restrict access to the `snapshot:load` command in production."*
How can I help you explore Laravel packages today?