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 Db Rebuild

Laravel Db Rebuild Laravel Package

webparking/laravel-db-rebuild

A Laravel package that adds a db:rebuild Artisan command to quickly reset your database by dropping all tables, rerunning migrations, and optionally seeding. Ideal for local development and testing, it makes repeatable database refreshes fast, consistent, and simple without manual SQL.

View on GitHub
Deep Wiki
Context7

A laravel package that allows for quick db rebuilds with presets.

Frequently asked questions about Laravel Db Rebuild
What does the webparking/laravel-db-rebuild package do?
It adds a db:rebuild Artisan command to Laravel that drops all tables in the configured database, re-runs your migrations, and can seed afterwards in a single call. The package advertises presets so common refresh scenarios can be repeated without retyping options. It is intended as local development and testing tooling rather than a runtime dependency, so it should be installed with --dev. In shape it is a thin convenience wrapper around Laravel's existing database reset commands.
How do I install webparking/laravel-db-rebuild?
Install it as a dev dependency with composer require --dev webparking/laravel-db-rebuild. The service provider is registered through package auto-discovery, so no manual provider entry is normally needed; check config/app.php only if you have discovery disabled. Then run php artisan db:rebuild against a disposable database to confirm the command registers and behaves as expected.
Is webparking/laravel-db-rebuild compatible with Laravel 11 and Laravel 12?
The last tagged release is dated 2020-09-10, which predates Laravel 9, 10, 11 and 12 as well as PHP 8.1 and later. Its Composer constraints on illuminate/support and illuminate/console will likely fail to resolve in a modern Laravel lockfile, or require a constraint override or a fork. Laravel 11 also reworked console kernel and command registration, so a 2020-era provider may register but behave unexpectedly. Treat Laravel 11 and 12 support as unverified until you spike it in a throwaway application.
How is db:rebuild different from php artisan migrate:fresh --seed?
In practice db:rebuild covers roughly the same ground as php artisan migrate:fresh --seed: wipe the schema, migrate, then seed. The advertised delta is presets and a shorter command name, which may or may not be worth a dependency depending on how heavily you use them. Before adopting, enumerate exactly which options and preset behaviours you need. If the answer is nothing beyond migrate:fresh --seed, a small internal wrapper command is the better trade.
Is it safe to run db:rebuild against a production or staging database?
It is not safe by default: the command drops all tables by design, so it should never run against production or shared staging data. The realistic failure mode is a misfire, such as a developer with a production .env loaded or a CI job with a misconfigured DB_HOST or DB_DATABASE, wiping non-ephemeral data. Gate the command behind environment checks and only point it at throwaway databases.
Can I use laravel-db-rebuild in CI pipelines?
It is usable in CI only if the target database is disposable and the dependency resolves in your lockfile. Remember that CI images install dev dependencies, so a Composer constraint conflict will block the pipeline even though production images use --no-dev. Pin the version, run it against an ephemeral database service container, and fail fast if the target database does not look like a test database.
How do presets work in laravel-db-rebuild?
Presets are the package's headline feature for repeatable rebuilds, letting you define common drop, migrate and seed combinations once and invoke them by name. Documentation in the repository is thin, so verify the exact preset syntax and option names by reading the command source in vendor/webparking before relying on it. If presets do not cover your scenarios, the feature adds little over calling migrate:fresh with your own flags.
Does db:rebuild handle views, triggers, foreign keys and multiple connections?
That behaviour is undocumented. The package description says it drops tables and re-runs migrations, but does not describe how it treats views, triggers, sequences, foreign key constraints or multiple database connections. A tool that drops tables while leaving views behind produces a database that is not reproducible, which defeats its stated purpose. Test it against a schema that includes views and triggers, and against each connection you configure, before trusting it.
Is webparking/laravel-db-rebuild still maintained?
The package has roughly 44 GitHub stars, no tagged release since September 2020, and appears to be maintained by a single author. That is acceptable for a dev-only tool you can replace in an afternoon, but risky if it becomes load-bearing in CI, where a silent break on a framework bump costs real time. Budget for the possibility of forking or replacing it, and avoid letting it gate Laravel upgrades.
What are the alternatives if I just want a faster Laravel database reset?
Laravel core already ships migrate:fresh, migrate:refresh, migrate:reset, db:wipe and the --seed and --seeder flags, which cover most rebuild needs. If you want a shorter command name or preset shortcuts, write a small internal Artisan command or Composer script that wraps migrate:fresh --seed and commit it to your application. That gives you the ergonomics with no third-party dependency, no abandoned-maintainer risk and no Composer constraint exposure.
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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
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