Scribe可以帮助您自动生成文档,但是如果您真的想制作友好,可维护和可测试的API文档,则还需要了解更多信息。所以我为你做了一门课程。🤗
|
6 years ago | |
---|---|---|
config | 6 years ago | |
docs | 6 years ago | |
resources | 6 years ago | |
src | 6 years ago | |
tests | 6 years ago | |
.editorconfig | 9 years ago | |
.gitattributes | 6 years ago | |
.gitignore | 6 years ago | |
.styleci.yml | 6 years ago | |
.travis.yml | 6 years ago | |
CHANGELOG.md | 6 years ago | |
CONTRIBUTING.md | 6 years ago | |
LICENSE.md | 9 years ago | |
README.md | 6 years ago | |
TODO.md | 6 years ago | |
body_params.png | 6 years ago | |
composer.json | 6 years ago | |
phpunit.xml | 6 years ago |
Automatically generate your API documentation from your existing Laravel/Lumen/Dingo routes. Here's what the output looks like.
php artisan apidoc:generate
Note: this is the documentation for version 3, which changes significantly from version 2. if you're on v2, you can check out its documentation here. We strongly recommend you upgrade, though, as v3 is more robust and fixes a lot of the problems with v2.
Note: PHP 7 and Laravel 5.5 or higher are required.
composer require mpociot/laravel-apidoc-generator
Publish the config file by running:
php artisan vendor:publish --provider="Mpociot\ApiDoc\ApiDocGeneratorServiceProvider" --tag=apidoc-config
This will create an apidoc.php
file in your config
folder.
bootstrap/app.php
:$app->register(\Mpociot\ApiDoc\ApiDocGeneratorServiceProvider::class);
vendor/mpociot/laravel-apidoc-generator/config/apidoc.php
to your project as config/apidoc.php
. Then add to your bootstrap/app.php
:$app->configure('apidoc');
Check out the documentation at ReadTheDocs.
The Laravel API Documentation Generator is free software licensed under the MIT license.