Download the PHP package svensp/laravel-swagger without Composer

On this page you can find all versions of the php package svensp/laravel-swagger. 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 laravel-swagger

laravel-swagger

this package tries to assist in generating api-doc.yml files for your laravel based apis.

It does not try to generate the whole api-doc.yml for you and thus does not function as complete abstraction layer for the openapi specification. Instead think of it as route:list that makes sure your open-api.yml files have all routes present and notify you of routes present in the open-api.yml but not in your laravel routes.

Install

to install the package simply require it with composer:

composer require svensp/laravel-swagger

Use

Annotate the controllers which should appear in an open-api.yml with

/**
* Class AuthController
* @apidoc path/to/your/open-api.yml
*/
class AuthController {
...

and have them created with

./artin open-api:generate

It is however recommended to publish the config file and use an alias:

./artisan vendor:publish --provider=LaravelSwagger\LaravelSwaggerProvider

The default settings map @ to app_path(), personally I map the name default to resource_path('/open-api.yml')

/**
* Class AuthController
* @apidoc @/resources/open-api.yml
* OR
* @apidoc default
* 
*/
class AuthController {
...

Tags

If you use the same open-api.yml for multiple controllers then you probably want to have the same tags set for all routes of the same controller. You an use the @apitags phpdoc directive to have this done automatically for you:

/**
* Class AuthController
* @apidoc default
* @apitags auth
*
*/
class AuthController {
...

/**
* Class NewsController
* @apidoc default
* @apitags news
*
*/
class NewsController {
...

the list of tags is parsed as comma separated list.

Roadmap

Use outside of Laravel

While I have not split the package in its laravel and open-api components it is possible to use it outside of Laravel. Simply instantiate the LaravelSwagger\OpenApi\Updater and pass an array of DefinedRoutes to its update function. Creating DefinedRoutes from your framework of choice is up to you, as is passing


All versions of laravel-swagger with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
illuminate/contracts Version ^7.0|^8.0|^9.0|^10.0|^11.0|^12.0
illuminate/support Version ^7.0|^8.0|^9.0|^10.0|^11.0|^12.0
illuminate/http Version ^7.0|^8.0|^9.0|^10.0|^11.0|^12.0
illuminate/console Version ^7.0|^8.0|^9.0|^10.0|^11.0|^12.0
illuminate/routing Version ^7.0|^8.0|^9.0|^10.0|^11.0|^12.0
symfony/yaml Version ^5.2|^6.0|^7.0
ext-json Version *
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 svensp/laravel-swagger contains the following files

Loading the files please wait ...