Custom Fresh - Keep specific tables during database resets
byโข
Custom Fresh v2.1.0 adds powerful new features for Laravel developers who need more control over database resets, including schema freezing, raw table preservation, configurable reset presets, related-table handling, fresh seeding, and safer foreign-key protection. ๐งน

Replies
๐ Custom Fresh v2.1.0 is here!
A major release making Laravel database resets more flexible, predictable, and safe, with better control over tables, migrations, related data, and reset workflows.
โจ Added
โ๏ธ Add the `--freeze-schema` option to mark every migration for kept tables as already run, skipping pending alter migrations when you want to leave the current schema untouched.
๐พ Add the `--keep-raw=` option to preserve tables that have no matching migration files.
๐ซ Add the `--except=` option to drop tables that would otherwise be kept by `always_keep` or `--keep`.
๐๏ธ Add the `--drop=` option to drop only the listed tables while preserving everything else.
โ๏ธ Add the `--preset=` option to apply named table groups from the configuration with a single flag.
๐ Add the `--with-related` option to also preserve tables linked by foreign keys to a kept table.
๐ Add the `--list` option to display discovered tables and the migration files that touch them.
๐ Add the `--json` option to output `--explain` and `--list` results as JSON for scripting and automation.
๐ฑ Add the `--seed-fresh` option to seed only dropped tables using the `table_seeders` configuration map.
๐๏ธ Add the `--drop-views` and `--drop-types` options so `fresh:custom` can match Laravel's `migrate:fresh` behavior.
๐งฉ Add the `keep_without_migrations`, `presets`, `table_seeders`, and `connections` configuration keys.
๐ Add the `replace_migrate_fresh` configuration key so `migrate:fresh` can delegate to `fresh:custom` when keep lists are configured.
๐ฌ Prompt interactively for tables when no tables, flags, or configuration lists are specified.
โ ๏ธ Warn about foreign-key relationships that could break after the drop step, allowing you to add `--with-related` or adjust the keep list before running.
๐งช Add PHPUnit and Orchestra Testbench coverage with a GitHub Actions matrix covering Laravel 10 through 13.
๐ Fixed
๐ Preserve sibling tables created in the same `Schema::create` migration as a kept table, so keeping `sessions` no longer drops `users` and breaks later foreign keys.
๐ Restore only already-applied migrations (and `Schema::create` files) for kept tables, allowing pending alter migrations to run correctly.