Download the PHP package despark/apidoc without Composer

On this page you can find all versions of the php package despark/apidoc. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package apidoc

apidoc

Laravel 5 api documentation generator, based on Swagger

apidoc use just a few lines of code added to your controllers methods.

Installation

Require this package with composer using the following command:

composer require despark/apidoc

After that add to the providers array in config/app.php

Despark\Apidoc\ApiDocServiceProvider::class,

Then call

php artisan vendor:publish

Now you are ready to use the generator.

Usage

If you do all steps mentioned above than the file /yourapp/config/apidoc.php should be generated for you.

<?php
return [
    'apiVersion'     => '1.0.0',
    'apiTitle'       => 'My api',
    'apiDescription' => 'My api',
    'apiBasePath'    => '/api/v1',
    'authorization' => 'jwt'
];

All those parameters are displayed on swagger api doc page so you can change them to fit your settings.

Authorization

By default swagger is configured to use JWT authentication via Authorization Header: Bearer. If you want standard auth trough query just change the authorization option to null.

For now these are the only authorization options available.

Controllers and methods

Every single method that has been documented in apidoc documentation way and present in laravel's routs.php will be parsed and shown in the api documentation. Method documentation example:

    /**
     * @apiDesc A description of the method
     * @apiParam string $parameterName required in_path | Description of the parameterName  
     * @apiParam array $parameterName2 | Description2 of the parameterName
     *
     * @apiErr 422 | Validation errors
     * @apiErr 403 | Unauthorized access
     * @apiResp 200 | Whatever message is send from backend on sucess
     */
    public function index($id, DesignRequest $request){}

Notice: Every single "@api" element and description should be on a single row.

You can set how the parameters are send and there are 3 options:

NOTICE: Everything after "|" symbol is assumed as a description text. So use just one "|" symbol on a row.

Command

After everything is setup, the controllers are declared in route.php file and there are comments in the controllers we can call the command.

php artisan apidoc:generate

That's it. Now you can access your new documentation at APP_URL/docs#/

Notice APP_URL is used for swagger integration. If it is not set in your .env file, the command will return a message, asking you to set up APP_URL.
Notice APP_URL example: http://example.info/


All versions of apidoc with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version 5.*
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package despark/apidoc contains the following files

Loading the files please wait ....