amjadiqbal/refresher
A Laravel package by Amjad Iqbal that provides a simple refresher utility for resetting and restoring application data, helping developers quickly return development or testing environments to a clean, known state with minimal setup.
migrate:fresh with a cached snapshot restore. Decision to make: is database setup a measurable line item in CI minutes and local test wait time? Instrument first (migration + seed time × runs/day × engineers), then decide.$seed, $seeder, or #[Seed]/#[Seeder] could silently run against an unseeded database — i.e. false-green tests. That is exactly the class of defect that kills trust in a test-infrastructure dependency. If an earlier evaluation was blocked on correctness grounds, re-run it; the trait now overrides only migrateDatabases() and passes migrateFreshUsing() through, so seeding, $dropViews, $dropTypes, and core's in-memory PDO cache behave as in RefreshDatabase.LazilyRefreshesWithRefresher (new) and RefreshesWithRefresher are drop-in replacements for LazilyRefreshDatabase and RefreshDatabase. Migration cost is a trait swap, which means the decision can be made at team level without an architecture review — low blast radius, easily reversed.loadMigrationsFrom() (auto-discovered), seeders/factories when seeding, the driver, and migrate:fresh options — and is machine-independent, so a snapshot built on one runner validates on every other. That makes "persist the snapshot as a CI artifact / cache layer" a viable pipeline decision rather than a fragile one.driver => mariadb) is now explicitly supported; SQLite WAL is checkpointed before snapshot and stale -wal/-shm files are removed on restore; MySQL restore now drops all tables and views first, matching migrate:fresh, so leftover branch-created or test-created tables no longer survive. This widens which services can adopt without caveats.Adopt when most of these hold:
symfony/process moved from ^6.0|^7.0 to ^7.2|^8.0, and PHP simplified to ^8.3. For apps still on PHP 8.1/8.2 or Symfony 6, v1.1.0 is effectively a breaking bump — confirm the version floor before committing, or stay pinned to the prior release.RefreshDatabase/LazilyRefreshDatabase and wants identical semantics rather than a new testing paradigm.Look elsewhere when:
migrate:fresh costs nothing measurable — the added indirection buys you nothing.php artisan about section now surfaces a support link, which suggests a support channel exists — validate its responsiveness before standardizing across many services.MYSQL_PWD rather than --password= (a genuine improvement: no CLI warning, not visible in the process list), but confirm it matches your policy.For executives: This is a small, narrowly scoped dependency that removes repeated database setup from our test runs — the kind of change that shows up directly as lower CI spend and shorter waits for engineers. The v1.1.0 release is mainly a correctness release: it closes a gap where seeded test suites could run against an unseeded database and pass for the wrong reasons, and it fixes environment and driver handling (MySQL credentials, sockets, long dumps timing out at 60 seconds, SQLite WAL artifacts). Cost of adoption is one trait swap per test base class; cost of reversal is the same. Recommend a single-service pilot with before/after CI minutes.
For engineering: Two drop-in traits — RefreshesWithRefresher and the new LazilyRefreshesWithRefresher — mirroring core's RefreshDatabase and LazilyRefreshDatabase. The v1.1.0 work deliberately restores core parity by overriding only migrateDatabases() and forwarding migrateFreshUsing(), so seeding, $dropViews, $dropTypes, and core's own $migrated/PDO bookkeeping are untouched. Snapshot invalidation is now driven by a machine-independent key that includes loadMigrationsFrom() paths (auto-discovered), seed paths, driver, and migrate:fresh options — meaning stale-snapshot bugs from branch switches or new seeders should be rare, and CI-cached snapshots are portable between runners. Operationally there is now refresher:clear to nuke all cached snapshots, --fresh-options on refresher:snapshot, and a Refresher section in php artisan about for version and snapshot path.
Pilot plan to de-risk the buy decision: swap the trait in one service, assert seeding parity explicitly (a test that fails if the DB is empty), compare CI wall time on the same commit range, and verify the PHP/Symfony floor in composer.json before merge.
How can I help you explore Laravel packages today?