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.
composer require patressz/laravel-model-documenter --dev (it's a dev tool that generates docblocks).php artisan model:document (or the equivalent command published by the package) to generate @property and @method docblocks on your Eloquent models.app/Models directory.--test to fail builds when docblocks drift, or --ci to regenerate and diff.--test step to your pipeline after composer install and Pint. This catches models where the generated docblock no longer matches reality, without mutating files.--ci): for repos that prefer the bot to keep docs fresh, run with --ci, then git diff --exit-code to assert nothing changed—same effect as --test but with an actionable diff.@property/@method types no longer produces false "outdated" failures.app/.@property/@method docblocks let static analysis resolve magic attributes and relationship return types without per-model @phpstan- annotations.--ci / --test false positives (fixed in v1.1.2): prior versions compared raw class strings, so any model processed by Pint (which imports FQCNs in docblocks) was flagged as outdated on every run. Upgrade to ≥ v1.1.2 before wiring the drift check into CI.--test step it will rewrite docblocks and your next run will still flag them—now not because of the bug, but because the generator ran against un-normalised input.@property/@method, blank lines). Configure stable ordering if the package exposes it, and commit generated docblocks in a dedicated commit to keep review diffs sane.@method entries are derived from the model's relationship methods—if a method's return type isn't an Eloquent relation or isn't typed, it won't be picked up. Add return types to relation methods.$appends: @property types follow casts and accessors; a custom accessor without a return type may generate a mixed/untyped property. Type your accessors.--test fails, run the generator without the flag and git diff the model—the diff shows exactly which property/method the tool thinks is stale, which is faster than reading the command's output.config/model-documenter.php for the formatter binding before forking.How can I help you explore Laravel packages today?