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 Model Doc Laravel Package

romanzipp/laravel-model-doc

Laravel Model Doc automatically generates PHPDoc annotations for your Eloquent models from the database schema, keeping IDE autocompletion and static analysis accurate. It saves you from manually maintaining model property docblocks as tables evolve.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. romanzipp/laravel-model-doc is a development-time code generation utility, not a runtime library. It scans Eloquent models, introspects the schema and relationship definitions, and writes @property / @method PHPDoc blocks into model source files. It sits entirely outside the request lifecycle, so it introduces zero production runtime coupling and no service-provider surface that affects deployed behavior. It complements static analysis tooling (Larastan/PHPStan, Psalm) and IDE autocomplete rather than replacing application logic. Fit is strongest in codebases with many Eloquent models and existing static-analysis gates; weaker in projects with heavy custom model conventions.

Integration feasibility. Low lift on paper: composer require --dev, optional config publish, one artisan invocation. The non-trivial work is operational, not technical — the command mutates tracked source files and likely requires a live database connection to introspect columns. That constrains where it can run (CI needs a DB service container, or pre-generated artifacts must be committed). A single bounded-context spike will confirm feasibility in under a day.

Technical risk. Medium-low overall, concentrated in three areas:

  • Source mutation: rewriting model files risks formatting churn, merge conflicts across branches, and clobbering hand-written PHPDoc. Any such tool must be run on a clean tree and reviewed as a diff.
  • Ecosystem maturity: 32 stars, 0 dependents, and a single maintainer imply low community validation and credible abandonment risk. Version lag on Laravel majors is the most probable future blocker.
  • Schema dependencies: if generation depends on schema introspection (Doctrine DBAL or similar), version constraints can become a friction point during Laravel/PHP upgrades, and CI must provision a database.

Key questions. Which Laravel and PHP versions are supported, and does the range cover our stack? Does it require a live DB, and for which drivers? Is there a dry-run/diff mode suitable for CI enforcement? Does it preserve or overwrite existing PHPDoc and custom tags? How does it handle custom casts, accessors, morph relations, and non-standard table/column naming? What is the maintainer's release cadence and issue response time?

Integration Approach

Stack fit. Composer/Laravel native; installs as a dev dependency alongside existing static-analysis tooling. It is additive and orthogonal to application architecture. It should not be treated as a replacement for intentional, business-semantic documentation — generated column lists are useful for tooling, not for explaining domain behavior.

Migration path. There is no migration in the data sense — the change is purely additive to the repository. The safe path is: install as --dev, publish config if defaults are insufficient, run the generator on a branch, and inspect the diff before committing anything. If the diff is noisy or destructive on a representative model, revert and stop; the cost of trying is measured in hours.

Compatibility. Verify the composer.json version constraints against our PHP matrix and Laravel major. Confirm auto-discovery behaves acceptably for a dev-only install. Test against the oldest and newest PHP versions we support, and against both a MySQL and PostgreSQL driver if the team uses both. If any schema-introspection dependency conflicts with our existing lock file, that is a hard stop warranting evaluation of a fork or an alternative.

Sequencing.

  1. Spike on one model file within a single bounded context; capture diff quality and false positives.
  2. If acceptable, roll out per domain/team rather than repo-wide — a repo-wide first run produces an unreviewable diff.
  3. Add a CI job that regenerates and runs git diff --exit-code to prevent documentation drift.
  4. Document the regeneration runbook (clean tree, branch, DB required, review diff) and a conflict-resolution policy for parallel branches touching the same models.
  5. Schedule this after the static-analysis baseline exists, so the improvement in PHPStan signal is measurable and attributable.

Operational Impact

Maintenance. Low in steady state because it is dev-only and never runs in production. The recurring cost is upgrade hygiene: each Laravel or PHP major requires confirming the package remains compatible. With zero dependents, there is no ecosystem pressure keeping it current — if it lags, the team either forks it or drops it, and either outcome should be planned for as a plausible cost. Budget a small recurring review per framework upgrade cycle.

Support. Community-only, single maintainer, MIT license, no vendor SLA. Acceptable only if the tool is non-critical to delivery. Treat it as a convenience layer that can be removed without architectural consequence; do not let it become a load-bearing part of the build.

Scaling. Generation time scales linearly with model and table count; very large applications (hundreds of models) may see multi-minute runs and should scope generation per domain. Git churn also scales — regenerated files across many models inflate PR diffs and review cost, which is the more meaningful scaling constraint than runtime.

Failure modes.

  • Partial or interrupted writes leaving malformed model files — mitigate with clean git state, branch-based runs, and CI-only execution with restore-on-failure.
  • DB connection unavailable in CI.
  • Documentation drift when schema changes and the command is not re-run.
  • Merge conflicts when parallel branches regenerate the same model.
  • Overwriting hand-written annotations, if the tool does not preserve them.

None of these are production-impacting, because the package never participates in request handling. The blast radius is confined to the repository and the developer workflow.

Ramp-up. Near-zero for engineers — one command and, at most, one config file. The real enablement is policy, not tooling: when to regenerate, how to review generated diffs, how to resolve conflicts, and a shared understanding that generated PHPDoc supplements rather than substitutes for semantic documentation.

Recommendation. Proceed with a scoped, low-commitment pilot. Gate broader adoption on two conditions: verified compatibility with our Laravel/PHP matrix, and a workable CI diff-check that keeps generated docs from drifting. Position the package as a developer-productivity convenience with an easy exit, not as an architectural dependency.

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