Weave 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 Fast Refresh Database

Laravel Fast Refresh Database Laravel Package

plannr/laravel-fast-refresh-database

Speed up database refreshes in your Laravel test suite. This package replaces slow migrate:fresh runs with a faster refresh strategy, so each test starts from a clean database without the long wait. Drop-in, configurable, and built for quick feedback loops.

View on GitHub
Deep Wiki
Context7

🚀 Refresh your test databases faster than you've ever seen before

Frequently asked questions about Laravel Fast Refresh Database
What is plannr/laravel-fast-refresh-database and how does it speed up Laravel tests?
It is a dev-only Laravel package that replaces slow migrate:fresh runs with a faster database refresh strategy for tests. Each test still starts from a clean database, but the reset path avoids the long wait that typically dominates test suite wall-clock time. It integrates through a service provider and a drop-in replacement for Laravel's RefreshDatabase test trait. Use it when database resets are a major cost in local or CI test runs.
How do I install plannr/laravel-fast-refresh-database in a Laravel app?
Install it as a development dependency with composer require --dev plannr/laravel-fast-refresh-database. Commit the lockfile and use a reasonably tight version constraint such as a caret constraint. No application code changes, schema changes, or infrastructure changes are required. Optionally publish the package configuration if you need to customize behavior.
How do I replace RefreshDatabase with the fast refresh trait?
Swap Laravel's RefreshDatabase trait for the package trait in your base TestCase or in individual test suites. The recommended approach is to wrap the vendor trait in an internal trait such as App\Testing\FastRefreshDatabase that extends the package trait. That gives you a one-line revert point and a fork point if upstream maintenance stalls. Keep the legacy trait available for any suites that fail validation.
Which Laravel and PHP versions does this package support?
The provided overview does not list an explicit Laravel and PHP version matrix. Check the package composer.json and README for supported constraints, and specifically confirm Laravel 11 and Laravel 12 coverage before adopting it. Because the package hooks into Laravel's database reset and test trait internals, verify compatibility against the exact framework version used in CI.
Which database engines are supported for the fast refresh?
The provided context does not specify which database drivers and versions are exercised. Validate the package against the same engines you use in CI and local Docker, such as MySQL 8, MariaDB, PostgreSQL, or SQLite in-memory. Pay particular attention to foreign keys, views, triggers, stored procedures, native enum types, and migrations that cannot run inside a transaction. Run the full suite on each engine before enabling the fast path broadly.
Does it work with Laravel parallel testing and ParaTest?
It is a good fit where parallel testing is already in play because it attacks the per-worker database reset cost. You still need to verify that resets serialize or isolate correctly across workers when using artisan test --parallel or ParaTest. Run the full parallel suite, not a subset, before enabling it in CI. If workers collide, keep the legacy trait for those suites until the setup is corrected.
Is this package safe to include in production?
It is a dev-only concern and should stay in require-dev, outside the production autoload path. The package targets Laravel's migrate:fresh and RefreshDatabase test path rather than application runtime behavior. When kept out of production dependencies, its blast radius on production code is effectively zero. Do not promote it to a runtime dependency.
Will the fast reset behave the same as migrate:fresh for complex schemas?
Any package that diverges from the canonical migrate:fresh path can mask schema drift, so treat equivalence as something to prove rather than assume. Test foreign keys, views, triggers, stored procedures, enum and native types, non-transactional migrations, seeding, schema:dump squashed migrations, and multi-connection setups. Compare the resulting schema state with the real migration path across every database engine you support. If a suite produces a different state, keep the legacy trait for that suite.
How should I roll it out and roll it back if something breaks?
Add it as a require-dev dependency with a tight constraint, commit the lockfile, and wrap it in an internal base trait that extends the vendor trait. Pilot on one high-churn test suite while keeping the legacy trait available for failing suites. Benchmark before and after on the same CI runner with a fixed commit, capturing total suite time, database-reset time, and runner minutes. Roll back by switching the base trait back to RefreshDatabase.
Is the package actively maintained, and what are the alternatives?
The last release noted in the assessment is 2024-04-08, with a single-organization package, 432 stars, and zero listed dependents, so vendor and bus factor risk is real. It is a thin utility, but an unmaintained shim over moving Laravel test internals can break at upgrade time, often in CI. Alternatives include the native migrate:fresh path, schema dumps or squashed migrations, and parallel test setup optimizations. Judge adoption on measured CI minutes saved rather than adoption optics.
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.
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core