Skip to content

An automatic api documentation generator for Laravel applications.

License

Notifications You must be signed in to change notification settings

cbeninati/laravel-api-autodoc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Notice

This package is currently in early alpha. It is not recommended to use on a production enviroment.

Due to changes in Lumen 5.2, this package needs updated to remove dependency on rendering Laravel views.

laravel-api-autodoc

An automatic api documentation generator for Laravel applications.

Quick Start

Installation

Install Through Composer

You can either add the package directly by firing this command

$ composer require rabblerouser/api-autodoc:*

-- or --

Add in the require key of composer.json file manually

"rabblerouser/api-autodoc": "*"

And Run the Composer update command

$ composer update

Add Service Providers (Lumen)

Add the following service providers to your bootstrap/app.php file.

$app->register(RabbleRouser\ApiAutoDoc\Providers\DocumentationServiceProvider::class);
$app->register('Irazasyed\Larasupport\Providers\ArtisanServiceProvider');

Add Service Providers (Laravel)

Add the following service providers to your config/app.php file.

'providers' => [
    // Other Service Providers
        RabbleRouser\ApiAutoDoc\Providers\DocumentationServiceProvider::class,
        'Irazasyed\Larasupport\Providers\ArtisanServiceProvider'
],

Override Doc View Templates

If you want to override the default view templates, run the artisan publish command.

$ php artisan vendor:publish

This will create a vendor/api-autodoc/views/ directory in the resources directory of your Lumen/Laravel installation. Api AutoDoc will load those templates instead of its defaults.

Usage

In your application's routes.php file, add a docCategory parameter to the route array.

Example

    $app->get('some_resource', [
        'uses' => 'App\Http\Controllers\SomeResourceController@index',
        'docCategory' => 'Some Resource'
    ]);

You can see your autogenerated API documentation by going to the /docs page of your site.

Example

    http://api.mywebservice.com/docs

TODO

  • add tests
  • update to remove dependency on Laravel views

License

MIT © Chad Beninati

About

An automatic api documentation generator for Laravel applications.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 59.0%
  • CSS 27.7%
  • JavaScript 13.3%