mirror of
https://github.com/ambieco/scribe.git
synced 2026-04-02 11:00:37 +08:00
Given that the API docs are just static files, the generator does not need to be shipped in production environments. Therefore, this change updates the `composer require` command in the README to only require the package in dev environments.
50 lines
2.3 KiB
Markdown
50 lines
2.3 KiB
Markdown
## Laravel API Documentation Generator
|
|
|
|
Automatically generate your API documentation from your existing Laravel/Lumen/[Dingo](https://github.com/dingo/api) routes. [Here's what the output looks like](http://marcelpociot.de/whiteboard/).
|
|
|
|
`php artisan apidoc:generate`
|
|
|
|
[](https://packagist.org/packages/mpociot/laravel-apidoc-generator)[](https://packagist.org/packages/mpociot/laravel-apidoc-generator)
|
|
[](https://packagist.org/packages/mpociot/laravel-apidoc-generator)
|
|
[](https://codecov.io/github/mpociot/laravel-apidoc-generator?branch=master)
|
|
[](https://scrutinizer-ci.com/g/mpociot/laravel-apidoc-generator/?branch=master)
|
|
[](https://travis-ci.org/mpociot/laravel-apidoc-generator)
|
|
[](https://styleci.io/repos/57999295)
|
|
|
|
## Installation
|
|
PHP 7 and Laravel 5.5 or higher are required.
|
|
|
|
```sh
|
|
composer require --dev mpociot/laravel-apidoc-generator
|
|
```
|
|
|
|
### Laravel
|
|
Publish the config file by running:
|
|
|
|
```bash
|
|
php artisan vendor:publish --provider="Mpociot\ApiDoc\ApiDocGeneratorServiceProvider" --tag=apidoc-config
|
|
```
|
|
|
|
This will create an `apidoc.php` file in your `config` folder.
|
|
|
|
### Lumen
|
|
- When using Lumen, you will need to run `composer require mpociot/laravel-apidoc-generator` instead.
|
|
- Register the service provider in your `bootstrap/app.php`:
|
|
|
|
```php
|
|
$app->register(\Mpociot\ApiDoc\ApiDocGeneratorServiceProvider::class);
|
|
```
|
|
|
|
- Copy the config file from `vendor/mpociot/laravel-apidoc-generator/config/apidoc.php` to your project as `config/apidoc.php`. Then add to your `bootstrap/app.php`:
|
|
|
|
```php
|
|
$app->configure('apidoc');
|
|
```
|
|
|
|
## Documentation
|
|
Check out the documentation at [ReadTheDocs](http://laravel-apidoc-generator.readthedocs.io).
|
|
|
|
### License
|
|
|
|
The Laravel API Documentation Generator is free software licensed under the MIT license.
|