Scribe可以帮助您自动生成文档,但是如果您真的想制作友好,可维护和可测试的API文档,则还需要了解更多信息。所以我为你做了一门课程。🤗
|
9 anni fa | |
---|---|---|
src | 9 anni fa | |
tests | 9 anni fa | |
.gitignore | 9 anni fa | |
LICENSE.md | 9 anni fa | |
README.md | 9 anni fa | |
composer.json | 9 anni fa | |
phpunit.xml | 9 anni fa |
php artisan api:gen --routePrefix=settings/api/*
Require this package with composer using the following command:
composer require mpociot/laravel-apidoc-generator
Go to your config/app.php
and add the service provider:
Mpociot\ApiDoc\ApiDocGeneratorServiceProvider::class
php artisan api:generate
{--output=public/docs : The output path for the generated documentation}
{--routePrefix= : The route prefix to use for generation - * can be used as a wildcard}
{--routes=* : The route names to use for generation - if no routePrefix is provided}
{--actAsUserId= : The user ID to use for API response calls}
The Laravel API Documentation Generator is free software licensed under the MIT license.