huangdijia/laravel-migrate-recreate
Adds a migrate:recreate Artisan command to Laravel that rolls back and re-runs only the migrations you specify, instead of refreshing the whole database. Handy in development for iterating on a single migration while leaving other tables and their data intact.
composer require --dev huangdijia/laravel-migrate-recreate. Confirm Laravel auto-discovery registers the service provider, or add it manually if your app disables discovery.php artisan list | grep migrate and run php artisan migrate:recreate --help after installation. The release notes for v2.1.0 only link to the full changelog, so verify the command signature and options locally before relying on them.config/migrate-recreate.php, and the command class. If config was published previously, compare it with the v2.1.0 changelog in case defaults changed.php artisan migrate:recreate, and confirm it drops/recreates the expected schema and re-runs migrations. Add --seed only if the package’s command exposes that option.migrate:recreate instead of manually dropping tables when migration state is corrupted. Pair it with your normal seeder command if the package does not seed automatically: php artisan migrate:recreate && php artisan db:seed.APP_ENV is local or testing, and avoid exposing it as a broadly available production command. Consider a custom wrapper command or composer script that checks the environment before invoking it.--seed, standardize a local seed set for repeatable demos. If not, keep seeding as a separate explicit step so reset and seed behavior remain obvious.RefreshDatabase or DatabaseMigrations; use migrate:recreate mainly for manual resets, acceptance environments, or test bootstrap scripts where a full destructive reset is acceptable."db:reset-local": "php artisan migrate:recreate" and document that it is destructive. This reduces accidental use in the wrong environment.--help, re-run it on a scratch database, and check whether config publishing or command options changed..env, cached config, or wrong DB_DATABASE can wipe the wrong schema.php artisan config:clear and, if applicable, php artisan package:discover.php artisan migrate:recreate -vvv and check Laravel logs. If the command is missing, verify package discovery and that the service provider is registered.require-dev unless you have a deliberate non-production use case that needs it at runtime. Production deployments should use normal migrate workflows.How can I help you explore Laravel packages today?