victorjonsson/markdowndocs
Generate single-page Markdown API docs from PHP DocBlocks. Install via Composer and run phpdoc-md to scan your source, include public/protected methods, respect @ignore, and infer missing types using reflection.
Pros:
php artisan).laravel.com, laravel-news.com, or custom wiki systems).Cons:
php artisan docs:generate) for CI/CD integration.app/ structure (e.g., App\Services\*) may require explicit path configuration.eval() or dynamic proxies) won’t be documented.@mixin, @route) may not render correctly.foreach by reference) or strict typing.Route::get()) or controllers.phpunit/phpunit@^10 and laravel/framework@^10.)Illuminate\Support\Facades or dynamic properties?php artisan doc (if available)?phpdoc-md in a custom Artisan command (e.g., php artisan docs:generate) for consistency.AppServiceProvider with configurable paths (e.g., config/docs.php).File facade or Storage to save/output Markdown to storage/docs/ or public/docs/.pre-commit or pre-push (via composer post-update-cmd).app/Modules/ directory).app/Http/Controllers/ and app/Services/ directories.@route, @middleware).phpdoc-md to composer.json with ^1.0 but pin to a specific version (e.g., 1.0.0) to avoid breaking changes.bootstrap/app.php as the --bootstrap file to ensure all autoloading is in place.config/docs.php to define:
'paths' => [
'src' => ['app/Http', 'app/Services'],
'ignore' => ['app/Tests', 'vendor'],
],
./vendor/bin/phpdoc-md generate app/Http > storage/docs/api.md
File facade to append timestamps or version info.Reflection is enabled in php.ini (default in Laravel).roave/phpstan-baseline or custom linting).composer.json:
"require-dev": {
"victorjonsson/markdowndocs": "1.0.0"
}
php artisan make:command DocsGenerate
- name: Generate Docs
run: php artisan docs:generate
phpdoc-md breaks, docs generation fails (mitigate with fallback scripts).pydoc-markdown) if the package becomes unusable.DocBlock.md guide in the repo with examples for controllers, services, and models.composer dump-autoload).@ignore tags or private/protected methods.phpdoc-md output to storage/logs/docs.log for errors.vendor/ and node_modules/ directories.php artisan docs:generate --parallel (if supported) or split into multiple steps.storage/docs/ (excluded from Git) or public/docs/ (versioned).api-controllers.md, api-services.md).| Failure Scenario | Impact | Mitigation |
|---|---|---|
phpdoc-md CLI fails |
Docs not generated | Fallback to manual process or script. |
How can I help you explore Laravel packages today?