rbr/laravel-api-docs
Composer 安装命令:
composer require rbr/laravel-api-docs
包简介
A self-analyzing tool that scans a Laravel project's routes, controllers, and FormRequests to generate browsable API documentation.
README 文档
README
A self-analyzing tool that scans a Laravel project's routes, controllers, and FormRequests to generate browsable API documentation.
Author: Rashedul Bari Raju (rbraju3m@gmail.com)
Installation
composer require rbr/laravel-api-docs
The package uses Laravel's auto-discovery, so the service provider will be registered automatically.
Setup
1. Publish the config file
php artisan vendor:publish --tag=api-docs-config
2. Run the migrations
php artisan migrate
3. Publish frontend assets (optional)
php artisan vendor:publish --tag=api-docs-assets php artisan vendor:publish --tag=api-docs-css php artisan vendor:publish --tag=api-docs-views
Usage
Generate API Documentation
php artisan api-docs:generate
php artisan api-docs:generate --project={id}
Browse Documentation
Visit http://your-app.test/docs/api
Configuration
Edit config/api-docs.php:
return [ 'title' => env('API_DOCS_TITLE', 'API Documentation'), 'description' => env('API_DOCS_DESCRIPTION', 'Auto-generated API documentation'), 'exclude_prefixes' => ['_ignition', '_debugbar', 'sanctum', 'docs/api', 'up'], 'route_prefix' => 'docs/api', 'middleware' => ['web'], 'copyright' => 'RBR Laravel API Doc', ];
Features
- Auto-scans Laravel routes, controllers, and FormRequests
- Parses docblock comments for endpoint descriptions
- Detects validation rules (FormRequest, inline, Validator::make)
- Generates realistic response examples from model $fillable, $casts, and migrations
- Supports external Laravel project scanning
- Manual endpoint CRUD
- Beautiful UI with React 19, Mantine UI v8, and Inertia.js
- Dashboard with stats, method distribution, and search
Requirements
- PHP 8.2+
- Laravel 11 or 12
- Inertia.js with React
License
MIT
© RBR Laravel API Doc by Rashedul Bari Raju. All rights reserved.
rbr/laravel-api-docs 适用场景与选型建议
rbr/laravel-api-docs 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 10 次下载、GitHub Stars 达 1, 最近一次更新时间为 2026 年 03 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「generator」 「documentation」 「api」 「laravel」 「Raju」 「rbr」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 rbr/laravel-api-docs 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 rbr/laravel-api-docs 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 rbr/laravel-api-docs 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Memio's PrettyPrinter, used to generate PHP code from given Model
Bookdown.io With Bootswatch Styles And Prism Syntax Highlighting
Laravel package that generates RESTful API documentation in Markdown based on PHPDoc.
A PSR-7 compatible library for making CRUD API endpoints
Laravel API documentation generating tool
RESTful API server for structured and self-documenting resources over JSON, XML, ...
统计信息
- 总下载量: 10
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 28
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-29