Skip to content

Commit 0e25996

Browse files
committed
Initial commit
0 parents  commit 0e25996

File tree

7 files changed

+615
-0
lines changed

7 files changed

+615
-0
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.DS_Store
2+
composer.lock
3+
.php_cs.cache
4+
/vendor/

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 Marcel Pociot
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
## Laravel API Documentation Generator (WIP)
2+
3+
`php artisan api:gen --routePrefix=settings/api/*`
4+
5+
6+
### Install
7+
8+
Require this package with composer using the following command:
9+
10+
```bash
11+
composer require mpociot/laravel-apidoc-generator
12+
```
13+
Go to your `config/app.php` and add the service provider:
14+
15+
```php
16+
Mpociot\ApiDoc\ApiDocGeneratorServiceProvider::class
17+
```
18+
19+
### Usage
20+
21+
22+
```
23+
php artisan api:generate
24+
{--output=public/docs : The output path for the generated documentation}
25+
{--routePrefix= : The route prefix to use for generation - * can be used as a wildcard}
26+
{--routes=* : The route names to use for generation - if no routePrefix is provided}
27+
{--actAsUserId= : The user ID to use for API response calls}
28+
```
29+
30+
31+
### License
32+
33+
The Laravel API Documentation Generator is free software licensed under the MIT license.

composer.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "mpociot/laravel-apidoc-generator",
3+
"license": "MIT",
4+
"description": "Generate beautiful API documentation from your Laravel / Lumen application",
5+
"keywords": ["API","Documentation","Laravel"],
6+
"homepage": "http://github.com/mpociot/apidoc",
7+
"authors": [
8+
{
9+
"name": "Marcel Pociot",
10+
"email": "[email protected]"
11+
}
12+
],
13+
"require": {
14+
"php": ">=7.0.0",
15+
"laravel/framework": "~5.0",
16+
"phpdocumentor/reflection-docblock": "~2.0"
17+
},
18+
"require-dev": {
19+
},
20+
"autoload": {
21+
"psr-0": {
22+
"Mpociot\\ApiDoc": "src/"
23+
}
24+
}
25+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
namespace Mpociot\ApiDoc;
4+
5+
use Illuminate\Support\ServiceProvider;
6+
use Mpociot\ApiDoc\Commands\GenerateDocumentation;
7+
8+
class ApiDocGeneratorServiceProvider extends ServiceProvider
9+
{
10+
11+
/**
12+
* Bootstrap the application events.
13+
*
14+
* @return void
15+
*/
16+
public function boot()
17+
{
18+
$this->loadViewsFrom(__DIR__.'/../../resources/views/', 'apidoc');
19+
}
20+
21+
/**
22+
* Register the API doc commands
23+
*/
24+
public function register()
25+
{
26+
$this->app['apidoc.generate'] = $this->app->share(function () {
27+
return new GenerateDocumentation();
28+
});
29+
30+
$this->commands(
31+
'apidoc.generate'
32+
);
33+
}
34+
35+
}

0 commit comments

Comments
 (0)