PHP code example of davmixcool / lumen-apidoc-generator

1. Go to this page and download the library: Download davmixcool/lumen-apidoc-generator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

davmixcool / lumen-apidoc-generator example snippets


$app->register(Davmixcool\ApiDoc\ApiDocGeneratorServiceProvider::class);

$api = app('Dingo\Api\Routing\Router');

$api->version('v1', function ($api) {
    $api->group(['namespace' => 'App\Http\Controllers'], function ($api) {
        // Custom get route added to standard Resource
        $api->get('example/get', 'ExampleController@foo');
        //Custom post route added to standard Resource
        $api->post('example/post', 'ExampleController@save');
    });
});

/**
 * @resource Example
 *
 * Longer description
 */
class ExampleController extends Controller {

	/**
	 * This is the short description [and should be unique as anchor tags link to this in navigation menu]
	 *
	 * This can be an optional longer description of your API call, used within the documentation.
	 *
	 */
	 public function foo(){

	 }

$this->validate($request,[
    'title' => 'n:foo,bar',
    'thumbnail' => '

/**
 * @transformer \Davmixcool\ApiDoc\Tests\Fixtures\TestTransformer
 */
public function transformerTag()
{
    return '';
}

/**
 * @transformercollection \Davmixcool\ApiDoc\Tests\Fixtures\TestTransformer
 */
public function transformerCollectionTag()
{
    return '';
}

/**
 * @response {
 *  data: [],
 *}
 */
public function responseTag()
{
    return '';
}

'url' => env('APP_URL', 'http://yourappdefault.app'),
sh
 $ php artisan vendor:publish