ycookies / apidoc
Automatic generation of API documentation for Laravel applications.
Fund package maintenance!
Requires
- php: ^8.1
- illuminate/contracts: ^10.0|^11.0|^12.0|^13.0
- myclabs/deep-copy: ^1.12
- nikic/php-parser: ^5.0
- phpstan/phpdoc-parser: ^1.0|^2.0
- spatie/laravel-package-tools: ^1.9.2
Requires (Dev)
- larastan/larastan: ^3.3
- laravel/pint: ^v1.1.0
- laravel/scout: ^10.0|^11.0
- nunomaduro/collision: ^7.0|^8.0
- orchestra/testbench: ^8.0|^9.0|^10.0|^11.0
- pestphp/pest: ^2.34|^3.7|^4.4
- pestphp/pest-plugin-laravel: ^2.3|^3.1|^4.1
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpunit/phpunit: ^10.5|^11.5.3|^12.5.12
- spatie/laravel-permission: ^6.10|^7.2
- spatie/pest-plugin-snapshots: ^2.1
Replaces
README
Scramble (ycookies fork)
Scramble generates API documentation for Laravel project. Without requiring you to manually write PHPDoc annotations. Docs are generated in OpenAPI 3.1.0 format.
Fork 增强
本 fork 在上游基础上增强了文档 UI,详见 docs/scalar-renderer.md:
- Scalar 渲染器:配置
renderer => 'scalar'切换;侧边栏支持分组 -> 模块 -> 接口三级导航(x-tagGroups) - 前端资源本地化:Scalar JS 内置包内并自动发布到
public/vendor/scalar/,不依赖 CDN - 全部展开 / 全部收起按钮、加载提示、中文界面(
localization.locale = 'zh-CN')
Documentation
You can find full documentation at scramble.dedoc.co.
Introduction
The main motto of the project is generating your API documentation without requiring you to annotate your code.
This allows you to focus on code and avoid annotating every possible param/field as it may result in outdated documentation. By generating docs automatically from the code your API will always have up-to-date docs which you can trust.
Installation
You can install the package via composer:
composer require dedoc/scramble
Usage
After install you will have 2 routes added to your application:
/docs/api- UI viewer for your documentation/docs/api.json- Open API document in JSON format describing your API.
By default, these routes are available only in local environment. You can change this behavior by defining viewApiDocs gate.