2017 © Pedro Peláez
 

library apidocs

Api documentation generator for Laravel 5

image

jetlee0797/apidocs

Api documentation generator for Laravel 5

  • Saturday, December 16, 2017
  • by jetlee0797
  • Repository
  • 1 Watchers
  • 0 Stars
  • 17 Installations
  • HTML
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 22 Versions
  • 6 % Grown

The README.md

ApiDocs Generator

Scrutinizer Code Quality Build Status, (*1)

L5 API Documentation generator based upon DocBlock comments., (*2)

Installation

You can install the package through Composer:, (*3)

composer require yaro/apidocs

Add this service provider and alias to config/app.php:, (*4)

'providers' => [
    //...
    Yaro\ApiDocs\ServiceProvider::class,
    //...
]

'aliases' => [
    //...
    'ApiDocs' => Yaro\ApiDocs\Facade::class,
    //...
]

Then publish the config and assets files:, (*5)

php artisan vendor:publish --provider="Yaro\ApiDocs\ServiceProvider"

And you should add a disk named snapshots to config/filesystems.php on which the blueprint snapshots will be saved:, (*6)

//...
'disks' => [
    //...
    'apidocs' => [
        'driver' => 'local',
        'root'   => storage_path('apidocs'),
    ],
//...    

Usage

All your routes must begin with some segment, e.g. /api/ (changed in config). Package will collect routes, that starts with this segment only., (*7)

Add to your route method DocBlock comment. e.g.:, (*8)

/**
 * Some api endpoint for important stuff.
 * 
 * Just show some template with     
 * some very long description    
 * on several lines
 * 
 * @param int    $offset   Just an offset size
 * @param string $password 
 */
public function getSomeStuff()
{
    return response()->json([]);
}

And create route to view your documentation., (*9)

Route::get('/docs', function() {
    return ApiDocs::show();
});

Also you can force authorization prompt by adding apidocs.auth.basic middleware. Authorized identites placed under apidocs.auth.credentials config., (*10)

Route::get('/docs', function() {
    return ApiDocs::show();
})->middleware(['apidocs.auth.basic']);

To exclude some routes/classes add them to config's exclude. Asterisks may be used to indicate wildcards., (*11)

'exclude' => [
    'classes' => [
        // 'App\Http\Controllers\*' - exclude all controllers from docs.
        // 'App\Http\Controllers\MyController@*' - remove all methods for specific controller from docs.
    ],

    'routes' => [
        // 'payment/test',
        // 'simulate/*',
    ],
 ],

Additionally you can create API Blueprint file:, (*12)

ApiDocs::blueprint()->create();
// or pass snapshot name and/or filesystem disc name
ApiDocs::blueprint()->create('my-newest-snapshot', 's3-blueprint');

Or just render its contents without creating file:, (*13)

echo ApiDocs::blueprint()->render();

Or via artisan:, (*14)

php artisan apidocs:blueprint-create

TODO

  • generate plain html page with all documentation info.
  • fullsize block with response.

License

The MIT License (MIT). Please see LICENSE for more information., (*15)

The Versions

16/12 2017

dev-master

9999999-dev

Api documentation generator for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel api documentation docs blueprint api blueprint

16/12 2017

0.3.7

0.3.7.0

Api documentation generator for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel api documentation docs blueprint api blueprint

04/12 2017

0.3.6

0.3.6.0

Api documentation generator for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel api documentation docs blueprint api blueprint

30/09 2017

0.3.5

0.3.5.0

Api documentation generator for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel api documentation docs blueprint api blueprint

22/09 2017

0.3.4

0.3.4.0

Api documentation generator for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel api documentation docs blueprint api blueprint

22/09 2017

dev-global_headers_save

dev-global_headers_save

Api documentation generator for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel api documentation docs blueprint api blueprint

10/09 2017

0.3.3

0.3.3.0

Api documentation generator for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel api documentation docs blueprint api blueprint

08/09 2017

0.3.2

0.3.2.0

Api documentation generator for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel api documentation docs blueprint api blueprint

06/09 2017

0.3.1

0.3.1.0

Api documentation generator for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel api documentation docs blueprint api blueprint

31/08 2017

0.2.1

0.2.1.0

Api documentation generator for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel api documentation docs blueprint api blueprint

24/08 2017

0.1.1

0.1.1.0

Api documentation generator for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel api documentation docs blueprint api blueprint

19/08 2017

0.0.11

0.0.11.0

Api documentation generator for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel api documentation docs

18/08 2017

0.0.10

0.0.10.0

Api documentation generator for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel api documentation docs

18/08 2017

0.0.8

0.0.8.0

Api documentation generator for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel api documentation docs

18/08 2017

0.0.9

0.0.9.0

Api documentation generator for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel api documentation docs

18/07 2017

0.0.7

0.0.7.0

Api documentation generator for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel api documentation docs

15/07 2017

0.0.6

0.0.6.0

Api documentation generator for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel api documentation docs

12/07 2017

0.0.5

0.0.5.0

Api documentation generator for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel api documentation docs

11/07 2017

0.0.4

0.0.4.0

Api documentation generator for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel api documentation docs

11/07 2017

0.0.3

0.0.3.0

Api documentation generator for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel api documentation docs

10/07 2017

0.0.2

0.0.2.0

Api documentation generator for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel api documentation docs

10/07 2017

0.0.1

0.0.1.0

Api documentation generator for Laravel 5

  Sources   Download

MIT

The Requires

 

laravel api documentation docs