2017 © Pedro Peláez
 

library apidocs

image

paplauskas/apidocs

  • Tuesday, July 31, 2018
  • by TadasPaplauskas
  • Repository
  • 1 Watchers
  • 2 Stars
  • 933 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 9 Versions
  • 3 % Grown

The README.md

ApiDocs

What is this repository for?

A simple plug-and-play Laravel 5 package that will generate a nice API documentation page based on your documented routes., (*1)

List view, (*2)

Setup

Do NOT install this package on your production environment unless you intend to make your API documentation public. In most cases it's best to keep it in the development environment., (*3)

Run this in your project folder:, (*4)

composer require paplauskas/apidocs --dev

Add this to the config/app.php providers:, (*5)

Paplauskas\ApiDocs\ApiDocsServiceProvider::class,

That's it!, (*6)

How do I use it?

If setting up ApiDocs went well, you should be able to access it through /apidocs route (for example http://website.dev/apidocs)., (*7)

Please note that you still have to document your endpoints by hand - ain't no magic here., (*8)

How to write documentation?

Just write comments right next to your routes. Api endpoint description format is pretty similar to the usual DocBlocks format. Write comments right before the route you wish to document. Example:, (*9)

    /**
    * @title Upload an image
    * @description Uploads the original image to the server, resizes it.
    * @group Images
    * @param  image
    * @param  scale
    * @return stored image url
    */
    Route::post('images/upload', 'ImageController@upload');

    /**
    * Get image
    * Returns image info
    * @group Images
    * @param  imageID
    * @return path
    * @return alt
    * @return width
    * @return height
    */
    Route::get('images/{imageID}', 'ImageController@show');

As you probably noticed, @ title and @ description are optional tags - the first line is always treated as a title. @param, @return can be declared in several lines if you want to. Description line is optional and doesn't have to be specified at all. Use whatever format is more readable to you., (*10)

Package is smart enough to recognise group prefixes, so don't worry about them., (*11)

Undocumented routes are ignored., (*12)

ApiDocs checks for routes in the usual locations: * app/Http/routes.php * routes/api.php * routes/web.php, (*13)

Found a bug?

File an issue in issue tracker., (*14)

The Versions

31/07 2018

dev-screenshots

dev-screenshots

  Sources   Download

27/09 2016

dev-develop

dev-develop https://github.com/TadasPaplauskas/apidocs

A simple plug-and-play Laravel 5 package that will automatically generate API documentation from your routes file.

  Sources   Download

MIT

The Requires

 

by Tadas Paplauskas

laravel api generator documentation docblock

27/09 2016

dev-master

9999999-dev https://github.com/TadasPaplauskas/apidocs

A simple plug-and-play Laravel 5 package that will automatically generate API documentation from your routes file.

  Sources   Download

MIT

The Requires

 

by Tadas Paplauskas

laravel api generator documentation docblock

27/09 2016

0.2

0.2.0.0 https://github.com/TadasPaplauskas/apidocs

A simple plug-and-play Laravel 5 package that will automatically generate API documentation from your routes file.

  Sources   Download

MIT

The Requires

 

by Tadas Paplauskas

laravel api generator documentation docblock

27/09 2016

dev-release/0.2

dev-release/0.2 https://github.com/TadasPaplauskas/apidocs

A simple plug-and-play Laravel 5 package that will automatically generate API documentation from your routes file.

  Sources   Download

MIT

The Requires

 

by Tadas Paplauskas

laravel api generator documentation docblock

20/04 2016

0.1.8

0.1.8.0 https://github.com/TadasPaplauskas/apidocs

A simple way to automatically document API routes

  Sources   Download

MIT

The Requires

 

by Tadas Paplauskas

laravel generator documentation

04/04 2016

0.1.7

0.1.7.0 https://github.com/TadasPaplauskas/apidocs

A simple way to automatically document API routes

  Sources   Download

MIT

The Requires

 

by Tadas Paplauskas

laravel generator documentation

01/04 2016

0.1.6

0.1.6.0 https://github.com/TadasPaplauskas/apidocs

A simple way to automatically document API routes

  Sources   Download

MIT

The Requires

 

by Tadas Paplauskas

laravel generator documentation

31/03 2016

0.1.5

0.1.5.0 https://github.com/TadasPaplauskas/apidocs

A simple way to automatically document API routes

  Sources   Download

MIT

The Requires

 

by Tadas Paplauskas

laravel generator documentation