PHPackages                             dennis1804/iq-swagger - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. dennis1804/iq-swagger

ActiveLibrary[API Development](/categories/api)

dennis1804/iq-swagger
=====================

Generates a swagger.json file with all your documented api/ routes

00[1 PRs](https://github.com/dennis1804/iq-swagger/pulls)JavaScript

Since Jun 15Pushed 1y ago1 watchersCompare

[ Source](https://github.com/dennis1804/iq-swagger)[ Packagist](https://packagist.org/packages/dennis1804/iq-swagger)[ RSS](/packages/dennis1804-iq-swagger/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

IQ-swagger
==========

[](#iq-swagger)

IQ-swagger is a package which converts docblocks into a user-friendly visual api-view (swagger)

[![Latest Stable Version](https://camo.githubusercontent.com/7614d43814cf3d1f8b6688605f6d4480ac592281b97b1a9ff1ed7caa06cdd4b8/68747470733a2f2f706f7365722e707567782e6f72672f64656e6e6973313830342f69712d737761676765722f762f737461626c65)](https://packagist.org/packages/dennis1804/iq-swagger) [![Total Downloads](https://camo.githubusercontent.com/1fdfc5029fe7ac66dc0b680c440c6c803e681eaec863dc791d9be255b5ca6b99/68747470733a2f2f706f7365722e707567782e6f72672f64656e6e6973313830342f69712d737761676765722f646f776e6c6f616473)](https://packagist.org/packages/dennis1804/iq-swagger) [![Latest Unstable Version](https://camo.githubusercontent.com/bab3dc0c34876eca073b93b690a3af2ee13f322853b25ea9c051f115118a5e95/68747470733a2f2f706f7365722e707567782e6f72672f64656e6e6973313830342f69712d737761676765722f762f756e737461626c65)](https://packagist.org/packages/dennis1804/iq-swagger) [![License](https://camo.githubusercontent.com/04fc8b93247a9caa389ef4e7cc0a4df66143fed943436e53b9bb0200d07411c9/68747470733a2f2f706f7365722e707567782e6f72672f64656e6e6973313830342f69712d737761676765722f6c6963656e7365)](https://packagist.org/packages/dennis1804/iq-swagger)

Getting Started
---------------

[](#getting-started)

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

### Prerequisites

[](#prerequisites)

What things you need to install the software and how to install them

```
- laravel project (5.5 >)
- PHP 7 >

```

### Installing

[](#installing)

Because this is an early start you need to add github to your composer.json

To add IQ-swagger to your laravel project you need to add the following lines to the composer.json file:

```
    "require": {
        "Dennis1804/iq-swagger": "dev-default",
    },
"repositories": [ { "type": "vcs", "url": "https://github.com/dennis1804/iq-swagger" } ]
```

Next you want to run the `composer update` command to download the project into the vendor folder. Then you need to open your `config/app.php` file and add the Serviceprovider for the package.

```
Dennis1804\IqSwagger\SwaggerServiceProvider::class,

```

Next to that it's recommended to add the JWT-auth package. this will provide an auth-token based login for your API. It will also work with the swagger documentation which requires a token to make most api-calls. alternatively you can use bearer tokens but this has not been tested.

now that the code is ready, you can add the javascripts to your public folder with: `php artisan vendor:publish`

php artisan iq:swagger
----------------------

[](#php-artisan-iqswagger)

The package also comes with an artisan command which has to be executed every time you have edited a docblock. this command will read all the docblocks and format them to a swagger.yaml / json file. all you have to do is execute the following command: `php artisan iq:swagger`This will read all the routes which have `api` in it.

The docblock
------------

[](#the-docblock)

The docblock is almost the normal docblock you would write (in sublime type: doc\_f) except there is one change. because swagger needs to know if the input is required or not you need to add a boolean in the inputs like so:

```
    /**
     * function authenticate
     *
     * @consumes multipart/form-data
     *
     * @param string email The email-address of the user true
     * @param string password the users password true
     *
     * @return json
     * @author Dennis
     **/
```

We will go from top to bottom with the docblock and explain what the package does with the lines.

\###function `function authenticate` just declares that the name of the function is "authenticate".

### Consumes

[](#consumes)

```
* @consumes multipart/form-data

```

Consumes is a custom added function which can identify what type of data the application needs. The following types are available.

```
"multipart/form-data",                  (POST)
"application/x-www-form-urlencoded"     (GET)

```

### params

[](#params)

in the `@param` attribute you can identify what content you expect from the `@consumes`*like the example, the method was post; and it requires an string: `email` and a string: `password`.*

```
 * @param string email The email-address of the user true
 * @param string password the users password true

```

The param has a couple of attributes;

```
Identifier                      @param
Type                            string
Name                            email
Description                     The email-address of the user
Required                        true

```

#### Type

[](#type)

There are multiple types available to choose from; The most important ones:

```

    string
    number
    integer
    boolean
    array
    object
    file

```

#### Name

[](#name)

This is just a name you can give the input-field.

#### Required

[](#required)

Boolean, true or false. indicates if the element is required or not.

#### Description

[](#description)

A short-description of the element.

### url

[](#url)

This is a customized `@param`, it uses the same attributes the only difference is that it identifies the url - parameters. if we have a route like this:

```
 Route::post('data/{checklistId}',  'Api\V1\Checklist\ChecklistController@pushData')    ->name('api.v1.checklist.pushData');
```

you can add a url param:

```
@url number checklistId required the checklist id

```

now can fill the url-param in the swagger-page.

### return

[](#return)

identifies what type of content you return. can either be one of these;

```
"application/xml"
"application/json"

```

### author

[](#author)

your name.

accessing the documentation:
----------------------------

[](#accessing-the-documentation)

you can just go to : `http://your-domain.dev/api` after you executed the `php artisan iq:swagger` command.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity31

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/9b19b140e69c2b95b59457b71181ba5494371a35129ebc694b716e88447dfc34?d=identicon)[Dennis1804](/maintainers/Dennis1804)

---

Top Contributors

[![dennis1804](https://avatars.githubusercontent.com/u/15904064?v=4)](https://github.com/dennis1804 "dennis1804 (27 commits)")

### Embed Badge

![Health badge](/badges/dennis1804-iq-swagger/health.svg)

```
[![Health](https://phpackages.com/badges/dennis1804-iq-swagger/health.svg)](https://phpackages.com/packages/dennis1804-iq-swagger)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M271](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[microsoft/microsoft-graph

The Microsoft Graph SDK for PHP

65723.5M96](/packages/microsoft-microsoft-graph)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
