Skip to content

This package is a wrapper for Swagger-php and makes it easy to integrate with Lumen/Larvarel

Notifications You must be signed in to change notification settings

paunin/laswagger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

paunin/laswagger

This package is a wrapper for Swagger-php and makes it easy to integrate with Lumen/Larvarel.

Usage

Installation

Via Composer

Add information about new package in your composer.json

    "require": {
    ...
        "paunin/laswagger": ">=1.0.0"
    ...
    }

After the composer install finishes, register the service provider:

  • Lumen Application:
$app->register(Laswagger\Providers\LumeSwaggerServiceProvider::class);
  • Laravel Application: not supports yet.

Now you can wo with laswagger:

  • Run php artisan swagger:generate file_name [base_host]: to generate swagger api docs.

  • Go to /swagger/api-docs (default routing config) to see swagger api docs in JSON format

Default configuration

<?php
return [
    'routes' => [
        'prefix' => 'swagger',
        'cors'   => false
    ],
    'api' => [
        'directories' => [base_path('app')],
        'excludes' => [],
        'host' => null
    ]
];

Customize configuration

In order to change default config you can copy the configuration template in config/laswagger.php to your application's config directory and modify according to your needs. For more information see the Configuration Files section in the Lumen documentation.

Tests

./vendor/phpunit/phpunit/phpunit

See test result at ./build

About

This package is a wrapper for Swagger-php and makes it easy to integrate with Lumen/Larvarel

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages