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 Migrate Fresh Laravel Package

spatie/laravel-migrate-fresh

Adds a migrate:fresh Artisan command to drop all database tables and rebuild from migrations, even if you don’t implement down() methods. Supports MySQL, SQLite, PostgreSQL, and SQL Server. (Built into Laravel 5.5+)

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Database Reset for CI/CD Pipelines: Enables seamless, repeatable database state for automated testing and deployment pipelines, reducing flakiness in test environments.
  • Developer Experience (DX) Improvements: Accelerates local development by providing a one-command solution to reset databases without manual rollbacks, especially useful for teams with incomplete or missing down() methods in migrations.
  • Build vs. Buy: Avoids reinventing a core DevOps tool; leverages a battle-tested, open-source solution to standardize database resets across teams.
  • Onboarding & Maintenance: Simplifies developer onboarding by ensuring a clean slate for new contributors, reducing friction in collaborative environments.
  • Data Privacy Compliance: Supports compliance needs (e.g., GDPR) by providing a controlled way to purge production-like data in staging environments without manual intervention.
  • Feature Flag Rollback Testing: Facilitates testing of feature flag rollbacks by resetting databases to a known state post-deployment.

When to Consider This Package

  • Adopt When:

    • Your team relies on Laravel migrations but lacks consistent down() methods in all migration files.
    • CI/CD pipelines require frequent, reliable database resets for testing or staging.
    • Developers spend excessive time manually resetting databases or debugging migration rollback failures.
    • You need a lightweight, no-frills solution for database teardowns (no need for complex backup/restore workflows).
    • Your project uses Laravel 5.5+ and PHP 7.2+ (or compatible versions).
  • Look Elsewhere If:

    • You require database backups before resets (this package nukes tables without backup).
    • Your team uses non-Laravel frameworks or need cross-framework solutions.
    • You need fine-grained control over specific table resets (e.g., soft deletes, partial resets).
    • Your migrations are highly complex with interdependent schemas that can’t tolerate brute-force table drops.
    • You’re using Laravel <5.5 (native migrate:fresh is built-in post-5.5).
    • Your compliance requirements mandate audit trails for data deletion (this package doesn’t log deletions).
    • You need parallelized resets for large-scale databases (this runs sequentially).

How to Pitch It (Stakeholders)

For Executives:

*"This package solves a critical pain point in our development workflow: database resets take 10x longer than they should, costing the team hours weekly in debugging and manual cleanup. By adopting spatie/laravel-migrate-fresh, we can:

  • Cut CI/CD failures by 30%+ with reliable, automated database resets.
  • Reduce onboarding time for new devs by 20% with a single command to reset their local environments.
  • Lower maintenance costs by eliminating custom scripts for database teardowns.
  • Future-proof our stack with a lightweight, MIT-licensed tool already used by [X] teams. The upfront cost is zero (open-source), and the ROI comes from time saved and reduced technical debt."*

For Engineering:

*"This is a drop-in replacement for migrate:refresh that works even when down() methods are missing. Key benefits:

  • One command (php artisan migrate:fresh) to nuke and rebuild the entire database—no more down() headaches.
  • Zero dependencies: Just a single Artisan command, no complex setup.
  • CI/CD friendly: Perfect for spinning up clean test databases in pipelines.
  • Backward compatible: Works with existing Laravel migrations (just add --seed to repopulate data).
  • Archived but stable: Last updated in 2018, but the core logic is rock-solid and now native to Laravel (we’re just using the pre-built version for older projects). Tradeoff: It’s a nuclear option—no backups or partial resets. Use it where you need a full reset, not incremental changes."*

For Developers:

*"Tired of migrate:refresh failing because someone forgot to write down()? This package fixes that with a brute-force table drop before running migrations fresh. Here’s how to use it:

  1. Install: composer require spatie/laravel-migrate-fresh.
  2. Run: php artisan migrate:fresh (add --seed to repopulate data). Pro tip: Add it to your .env scripts for local dev:
alias db-reset='php artisan migrate:fresh --seed'

When to avoid: If you need backups or partial resets, use this only for full teardowns."*

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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport