定制 rbr/laravel-api-docs 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

rbr/laravel-api-docs

最新稳定版本:v1.0.7

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.

统计信息

  • 总下载量: 10
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 4
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-03-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固