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

Technical Evaluation

Assessment status: adopt-with-conditions, defaulting to build-not-buy. This package is a single Artisan command that drops all tables, re-runs migrations, and optionally seeds. It belongs in the development/CI tooling bucket, not the runtime dependency bucket — a materially smaller blast radius than a request-path library, but with one sharp edge: the command is destructive by design, so the dominant risk is misfire, not coupling.

Architecture fit. The integration surface is about as small as Laravel packages get: one console command, registered via a service provider (auto-discovered through extra.laravel.providers) or an explicit $commands array. No facades, no middleware, no queue jobs, no schema mutations we inherit. Fit against a conventional Laravel 11/12 app is high in shape and questionable in value, because Laravel core already ships migrate:fresh, migrate:refresh, migrate:reset, db:wipe, and --seed / --seeder. On paper, php artisan db:rebuild ≈ php artisan migrate:fresh --seed. The TPM question is therefore not "how do we integrate this" but "what does this give us that the framework does not, and is that delta worth a dependency we must maintain?" If the answer is "nothing but a shorter command name," the correct decision is a two-line internal wrapper, not a third-party package.

Integration feasibility. Mechanically trivial: composer require --dev webparking/laravel-db-rebuild, confirm discovery, run the command against a disposable database. Elapsed effort for the spike is hours. The feasibility risk is entirely in compatibility, because the last release is 2020-09-10 — pre-dating Laravel 9, 10, 11, and 12, and predating PHP 8.1+. Two concrete unknowns:

  • Console registration drift. Laravel 11 restructured console kernel and command registration. A 2020-vintage provider that pushes commands into Artisan::starting() or assumes app/Console/Kernel.php may register cleanly but behave unexpectedly, or not at all.
  • Composer constraint resolution. The package almost certainly declares illuminate/support and illuminate/console ranges that stop at Laravel 7/8. Adding it to a Laravel 11/12 lockfile will either fail the solve or require a constraint override / fork — at which point we are maintaining a fork of a dev tool, which is a poor trade.

Because it is dev-only, this risk is containable (require-dev, excluded from production images via composer install --no-dev), but it is not free: CI images install dev dependencies, so a constraint conflict still blocks the pipeline.

Technical risk. Ranked by expected impact:

  1. Destructive misfire against a non-ephemeral database (low likelihood, catastrophic impact). The command drops tables by design. A misconfigured DB_HOST/DB_DATABASE env var in CI, or a developer running it with a production/staging .env loaded, is a data-loss incident. This is the single reason to gate adoption on guardrails rather than convenience.
  2. Redundancy / negative value (high likelihood, medium impact). If the feature set is a subset of migrate:fresh --seed, we take on upgrade coupling and a fork obligation for zero capability gain.
  3. Abandonment (high likelihood, medium impact here). 44 stars, no release in ~5 years, likely single maintainer. Acceptable for a dev tool we can replace in an afternoon; unacceptable if it becomes load-bearing in CI and silently breaks on a framework bump.
  4. Constraint conflict blocking framework upgrades (medium). Even as a dev dependency, it can pin the whole composer.lock and block a Laravel major.
  5. Undocumented destructive semantics (medium). Unknown handling of views, triggers, foreign keys, and multiple connections. A tool that drops tables but leaves views/sequences behind produces a database that is not reproducible — the exact property it claims to deliver.

Key questions. Answer before converting from provisional to a decision:

  • What does db:rebuild do that migrate:fresh --seed does not? Enumerate the actual diff in behaviour, flags, and edge cases.
  • What require constraints does the tagged release declare, and does it solve against our current composer.lock on Laravel 11/12 and PHP 8.2–8.4 without overrides?
  • Does the command require confirmation, an --force flag, or an environment guard (APP_ENV !== production) before dropping tables?
  • How does it handle views, triggers, sequences, foreign-key ordering, and non-default connections (MySQL, Postgres, SQLite)?
  • Is there a --dry-run or any non-destructive mode?
  • Who maintains it, what is the issue-response time, and are we prepared to fork it if it breaks on the next Laravel major?
  • What is the licence (stated MIT) and does it cover internal fork-and-modify?

Integration Approach

Stack fit. Treat this as CI/dev-only tooling: require-dev in composer.json, absent from production images, never referenced by application code. It should sit alongside PHPUnit, Pint, and Larastan in the "tooling we could rewrite in an afternoon" category. If any proposed use case touches a shared, persistent, or staging database, stop — that is out of scope for this class of tool.

Migration path. Sequence the cheap disproof first, because the most likely outcome is "we don't need this":

  1. Redundancy check (0.5 day). Run migrate:fresh --seed and db:rebuild against the same throwaway database and diff the resulting schema (table counts, views, indexes, FK constraints). If the schemas match, the package is redundant and the evaluation ends here.
  2. Constraint spike (0.5 day). On a scratch branch, add the package and record the Composer solver output verbatim. If it forces a constraint override, the decision becomes "fork" — usually not worth it for dev tooling.
  3. Guardrail implementation (0.5 day). Before any shared use: an explicit APP_ENV/DB_HOST allowlist check in our CI wrapper, DB name convention for ephemeral databases, and a confirmation prompt retained for interactive use.
  4. CI enablement (0.5 day). Wire into one pipeline first, measure duration against the existing migrate:fresh step, then roll to others.

If the redundancy check fails (the package genuinely adds capability), the fallback is a ~20-line internal Artisan command wrapping db:wipe + migrate --seed, which removes the dependency entirely at roughly the same engineering cost as the guardrail work above.

Compatibility. Three axes to clear:

  • Framework version — does it resolve and register on Laravel 11/12, including the post-11 console kernel changes?
  • Database engine — does "drop tables" mean the same thing on MySQL and Postgres? Verify views, sequences, and FK ordering explicitly.
  • Seeder contract — does --seed use our DatabaseSeeder, and does it fail loudly or leave a half-seeded database?

Sequencing. Do not introduce this and a Laravel major upgrade in the same change. Land the guardrails (step 3) with or before the first shared-pipeline use — a destructive command without an environment guard should never reach CI. If replacing an existing make-target or script, run both in parallel for one iteration and compare resulting schemas before deleting the incumbent.

Operational Impact

Maintenance. Low absolute cost, but asymmetric: the package has had no release in ~5 years, so any framework incompatibility is ours to fix, not upstream's. Budget 1–2 hours per Laravel major to verify the command still works, plus the possibility of a one-time fork if it doesn't. The dependency's real cost is that it sits in the lockfile and can block a framework upgrade for a convenience command — a poor leverage ratio. Mitigation: keep it dev-only and pre-accept that we will replace it with an internal command at the first sign of friction.

Support. Community-only, effectively unmaintained. Acceptable here only because it never runs in production and its failure mode is "CI step errors," not "customer-facing incident." Confirm we can read and patch the source (MIT permits it) — a 2020-vintage package that breaks on the next major should be forked or replaced, not worked around.

Scaling. Runtime scaling is not applicable; the relevant "scale" is CI throughput and database provisioning:

  • A full drop-and-remigrate per pipeline gets slower as migrations accumulate. Measure it; if it becomes a bottleneck, consider schema dumps (schema:dump) or per-worker ephemeral databases rather than optimising the rebuild command.
  • Parallel CI jobs need distinct database names per job, or the command will drop tables out from under a concurrent job — a self-inflicted, hard-to-diagnose failure.
  • Seeder duration dominates as fixture volume grows; keep the CI seed set minimal and separate from developer fixtures.

Failure modes.

Failure mode Signal Control
Command run against staging/production Tables dropped, data loss Environment guard + host allowlist in wrapper; never expose in prod image (--no-dev)
Constraint conflict blocks framework upgrade Composer solver error Spike before commitment; dev-only placement limits but does not remove the risk
Package unmaintained, breaks on Laravel major Command missing or errors post-upgrade Pin exact version; fork readiness; fallback internal wrapper
Silent incompleteness (views/triggers/sequences survive) Schema drift between rebuilds Diff schemas vs migrate:fresh in the spike; fail CI on drift
Concurrent CI jobs collide Intermittent "table already exists" / missing table Per-job unique database name; no shared CI database
Seeder failure mid-run Partially populated DB, flaky tests Fail-fast seeding; treat non-zero exit as pipeline failure, no retry
Timeout on larger schemas CI step exceeds budget Measure; consider schema dump baseline

Ramp-up. Near-zero. Any Laravel engineer understands artisan db:rebuild from the name alone. The non-obvious knowledge worth capturing in a one-paragraph runbook is the safety envelope: which environments it may target, how ephemeral databases are named, and what to do when it fails. That runbook is the actual deliverable of the integration, more so than the dependency itself.

Conditional recommendation. Default to build, not adopt: an internal command wrapping db:wipe + migrate --seed delivers the same outcome with no dependency, no 2020 constraint risk, and full control over destructive-safety guards. Proceed to adopt the package only if (a) the redundancy check shows a genuine capability gap we would otherwise have to implement, and (b) it resolves cleanly against our current Laravel 12 / PHP 8.2–8.4 lockfile without overrides. If either gate fails, close as "no action — covered by framework core."

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.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core