elalecs/laravel-documenter
Composer 安装命令:
composer require elalecs/laravel-documenter
包简介
An automated documentation generator for Laravel and Filament projects. It analyzes your project structure, including models, Filament resources, controllers, jobs, events, middlewares, and rules, to create comprehensive Markdown documentation. Ideal for quickly onboarding new developers or maintain
README 文档
README
Laravel Documenter is an automated documentation generator for Laravel and Filament projects. Its primary purpose is to generate or extend the CONTRIBUTING.md file of your project, providing a comprehensive overview of your project's structure and components.
Features
- Automatically generates or extends the CONTRIBUTING.md file in your Laravel project
- Documents key components: Models, Filament Resources, API Controllers, Jobs, Events, Middlewares, and Rules
- Uses customizable stubs for flexible documentation formatting
- Helps quickly onboard new developers by providing an up-to-date project overview
- Integrates seamlessly with Laravel and Filament projects
Requirements
- PHP 7.3 or higher
- Laravel 8.0 or higher
Installation
You can install the package via composer:
composer require elalecs/laravel-documenter --dev
Configuration
Publish the configuration file:
php artisan vendor:publish --provider="Elalecs\LaravelDocumenter\LaravelDocumenterServiceProvider" --tag="config"
This will create a config/laravel-documenter.php file where you can customize the behavior of the package.
Usage
To generate or update your project's CONTRIBUTING.md file:
php artisan documenter:generate
This command will:
- Analyze your project structure
- Generate documentation for each component (Models, Filament Resources, etc.)
- Create or update the CONTRIBUTING.md file in your project root
You can also generate documentation for specific components:
php artisan documenter:generate --type model
Available types are: model, filament, api, and general.
Customization
You can customize the documentation output by publishing and modifying the stub files:
php artisan vendor:publish --provider="Elalecs\LaravelDocumenter\LaravelDocumenterServiceProvider" --tag="stubs"
This will copy the stub files to your resources/views/vendor/laravel-documenter directory. After publishing, update your config/laravel-documenter.php file to point to your custom stubs:
'stubs_path' => resource_path('views/vendor/laravel-documenter'),
Important: DocBlocks
For Laravel Documenter to function effectively, it's crucial that your code includes properly formatted DocBlocks. These DocBlocks should be present on:
- Classes
- Methods (especially
handle()methods in Jobs and Middleware, andpasses()methods in Rules) - Properties
Include @description tags in your DocBlocks to provide detailed information about the purpose and functionality of your components.
Example:
/** * @description This job processes user uploads and generates thumbnails. */ class ProcessUserUpload implements ShouldQueue { // ... }
The more comprehensive your DocBlocks, the more detailed and useful the generated documentation will be.
Updating
When updating the package, make sure to republish the configuration file and clear the config cache:
composer update elalecs/laravel-documenter php artisan vendor:publish --provider="Elalecs\LaravelDocumenter\LaravelDocumenterServiceProvider" --tag="config" --force php artisan config:clear
Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
For more details on how to contribute, please check our CONTRIBUTING.md file.
License
The Laravel Documenter is open-sourced software licensed under the MIT license.
Credits
elalecs/laravel-documenter 适用场景与选型建议
elalecs/laravel-documenter 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 12 次下载、GitHub Stars 达 0, 最近一次更新时间为 2024 年 08 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 elalecs/laravel-documenter 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 elalecs/laravel-documenter 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 12
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 20
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-08-06