Download the PHP package aluisio-pires/laravel-swagger-docs without Composer

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

Laravel Swagger Docs

Simple to use OAS3 compatible documentation generator.
Also includes Swagger UI.

About

This package is heavily inspired by the darki73/laravel-swagger and kevupton/laravel-swagger.
Usage is pretty similar to the mtrajano/laravel-swagger with the difference being:

  1. OAS3 support
  2. Custom decorators
  3. Custom responses
  4. Automatic generation (assuming relevant configuration option is turned on)
  5. Inclusion of Swagger UI
  6. Models generations
  7. Generate operation tags based on route prefix or controller's name

Installation

Install package through composer

Publish configuration files and views

Edit the swagger.php configuration file for your liking

Usage

Laravel Swagger Docs works based on recommended practices by Laravel. It will parse your routes and generate a path object for each one. If you inject Form Request classes in your controller's actions as request validation, it will also generate the parameters for each request that has them. For the parameters, it will take into account wether the request is a GET/HEAD/DELETE or a POST/PUT/PATCH request and make its best guess as to the type of parameter object it should generate. It will also generate the path parameters if your route contains them. Finally, this package will also scan any documentation you have in your action methods and add it as summary and description to that path, along with any appropriate annotations such as @deprecated.

One thing to note is this library leans on being explicit. It will choose to include keys even if they have a default. For example it chooses to say a route has a deprecated value of false rather than leaving it out. I believe this makes reading the documentation easier by not leaving important information out. The file can be easily cleaned up afterwards if the user chooses to leave out the defaults.

Command line

Generating the swagger documentation is easy, simply run php artisan swagger:generate in your project root. The output of the command will be stored in your storage path linked in config file.

If you wish to generate docs for a subset of your routes, you can pass a filter using --filter, for example: php artisan swagger:generate --filter="/api"

You can also configure your swagger.php file to always generate schema when accessing Swagger UI or just by adding this line in your .env: SWAGGER_GENERATE_ALWAYS=true

By default, laravel-swagger prints out the documentation in json format, if you want it in YAML format you can override the format using the --format flag. Make sure to have the yaml extension installed if you choose to do so.

Format options are: json yaml

@Request() decorator

You can have only one @Request() decorator.

@Response() decorator

You can have multiple @Response decorators

Note: You can see all available schema builder or create your own schema builder, explore swagger.schema_builders config for more informations.

Custom Validators

These validators are made purely for visual purposes, however, some of them can actually do validation

swagger_default

swagger_min

swagger_max



All versions of laravel-swagger-docs with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
doctrine/dbal Version *
phpdocumentor/reflection-docblock Version ^5.2
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 aluisio-pires/laravel-swagger-docs contains the following files

Loading the files please wait ....