Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Db Snapshots Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Database-driven feature development: Accelerate iteration by capturing and restoring database states for rapid prototyping, A/B testing, or feature experimentation without manual data migration.
  • Test environment consistency: Eliminate "works on my machine" issues by providing reproducible database snapshots for CI/CD pipelines, QA environments, or developer onboarding.
  • Disaster recovery/rollbacks: Enable quick rollback to known-good states for critical production issues (e.g., post-deployment bugs) by storing snapshots in version control or cloud storage.
  • Multi-environment parity: Synchronize staging/production data (with caution) for debugging or analytics without exposing sensitive data.
  • Build vs. buy: Avoid reinventing database backup/restore logic for Laravel apps, reducing technical debt and maintenance overhead.
  • Use cases:
    • Feature flags: Test toggled features in isolation by restoring snapshots before/after activation.
    • Data migration validation: Compare snapshots pre/post-migration to verify integrity.
    • Performance testing: Load identical datasets across environments to benchmark queries.
    • Local development: Reset dev databases to production-like states without manual scripts.

When to Consider This Package

  • Adopt if:
    • Your Laravel app relies on complex, stateful database interactions (e.g., relationships, triggers, or custom logic).
    • You lack a robust backup strategy for development/staging environments.
    • Your team frequently needs to reset or compare database states (e.g., for bug reproduction).
    • You’re using MySQL, PostgreSQL, or SQLite (MariaDB support is experimental).
    • You prioritize speed over granularity (e.g., full-database snapshots vs. incremental backups).
  • Look elsewhere if:
    • You need incremental backups or point-in-time recovery (consider spatie/laravel-backup or native tools like pg_dump/mysqldump).
    • Your database exceeds memory limits for streaming (use --stream flag or external tools).
    • You require cross-database compatibility (e.g., MySQL → PostgreSQL; this package is DB-agnostic per snapshot).
    • You need fine-grained table-level permissions or row-level security preservation (snapshots may not capture all metadata).
    • Your team prefers GUI tools (e.g., Adminer, phpMyAdmin) for manual snapshots.

How to Pitch It (Stakeholders)

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:

  • Ship faster: Test database-heavy features in isolation by restoring snapshots before/after changes.
  • Debug with confidence: Reproduce bugs by loading a snapshot of the exact state where they occurred.
  • Simplify CI/CD: Spin up identical test databases in pipelines using snapshot:load.
  • Reduce toil: Replace manual 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."*
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai