patressz/laravel-model-documenter
Laravel Model Documenter automatically generates clear documentation for Eloquent models, covering attributes, casts, relationships, accessors, mutators, scopes, and more. Keep model reference docs accurate and in sync as your schema and codebase evolve.
@property and @method annotations for Eloquent models, sourced from migrations/schema and model definitions. This removes a recurring manual chore and is the core build-vs-buy lever: buy (free, MIT-style OSS) versus building an internal generator.--ci / --test modes turn "are the model docs still accurate?" into a pass/fail gate. This is the highest-leverage feature for a PM: it converts a documentation standard from a polite request into an automated check, which is the only kind of documentation standard that survives a busy sprint.@property and @method types let Larastan/PHPStan, Psalm, and IDE intelligence resolve model attributes, relationships, scopes, and accessors. This supports roadmap decisions around raising static-analysis levels without a multi-quarter typing initiative.tinker.--ci/--test reported every formatted model as outdated once a formatter ran. That is a false-positive generator: teams would have disabled the check within a sprint, or worse, adopted it and lost trust in CI signal. v1.1.2 expands imported class names via the model's imports and namespace before comparison, making the gate trustworthy in real pipelines where Pint is already enforced.Adopt when most of the following are true:
Look elsewhere or defer when:
-> attribute casts, polymorphic or non-Eloquent access, or stored procedures will produce incomplete or misleading annotations, and misleading types are worse than none.barryvdh/laravel-ide-helper overlap substantially. If the goal is editor autocompletion rather than committed, reviewable, CI-checkable docs, the marginal value here is low.For executives (one paragraph): Model documentation in a Laravel codebase is normally written by hand and silently rots as migrations land — which is why new engineers take weeks to become productive and why static analysis finds so few real bugs in our models. This package generates that documentation directly from the schema and models, and — critically — lets CI fail when it goes stale, so accuracy stops depending on discipline. The cost is a single artisan command plus one CI step, no runtime dependency, and no vendor contract. The v1.1.2 release fixed the blocker that previously made the CI check unusable alongside our formatter: it was flagging every formatted model as outdated, which would have caused the team to switch the check off. That fix is what makes this safe to adopt, and I recommend piloting it on the highest-churn domain first.
For engineering leadership and platform teams: This is a build-vs-buy decision that resolves to "buy," because the generator is commodity and the maintenance burden of an in-house version is not. Adoption path: add the package as a dev dependency with a pinned constraint, run the generator once to establish a baseline, commit the resulting diffs, then wire --test (or --ci) into the existing Pint/lint stage so documentation drift is caught in the same job that already enforces style. The v1.1.2 change is the enabler for that ordering — class names are now resolved through each model's imports and namespace before comparison, so a Pint-formatted codebase no longer produces universal false positives. Expected outcomes: better Larastan/PHPStan coverage without a typing initiative, faster onboarding on the models that carry the most domain logic, and a documentation standard that enforces itself. Risks to name up front: pre-2.0 version churn, incomplete annotations where dynamic or non-schema attributes are used, and PR noise from regeneration — all manageable with a pinned version, a documented scope for the pilot, and a regeneration step in the migration checklist.
For the immediate team: Run it on one service boundary first, confirm the CI gate is green on a formatted branch, and measure two things over the following month — static-analysis findings touching models, and time-to-first-merged-PR for new joiners. If both move, extend to the rest of the codebase.
How can I help you explore Laravel packages today?