PHPackages                             chriha/laravel-api-documentation - 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. chriha/laravel-api-documentation

ActiveLibrary[API Development](/categories/api)

chriha/laravel-api-documentation
================================

description

v2.1.0(1y ago)116.9k↓34.1%1MITPHPPHP ^8.0|^8.1|^8.2|^8.3|^8.4CI passing

Since Mar 17Pushed 1y ago2 watchersCompare

[ Source](https://github.com/chriha/laravel-api-documentation)[ Packagist](https://packagist.org/packages/chriha/laravel-api-documentation)[ RSS](/packages/chriha-laravel-api-documentation/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (14)Used By (0)

Automatically Provide A Swagger Documentation For Your Specs
============================================================

[](#automatically-provide-a-swagger-documentation-for-your-specs)

[![screenshot](https://user-images.githubusercontent.com/53882/112632601-9d1a6e80-8e38-11eb-8e5b-8a2432c51336.png)](https://user-images.githubusercontent.com/53882/112632601-9d1a6e80-8e38-11eb-8e5b-8a2432c51336.png)

[![version](https://camo.githubusercontent.com/127060ab1b13065cb57d5eb1ed08490d3af0e26706479aa7b849e039796342fc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6368726968612f6c61726176656c2d6170692d646f63756d656e746174696f6e)](https://camo.githubusercontent.com/127060ab1b13065cb57d5eb1ed08490d3af0e26706479aa7b849e039796342fc/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6368726968612f6c61726176656c2d6170692d646f63756d656e746174696f6e)

This package helps providing a parsed Swagger documentation by using your OpenAPI YAML files.

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

[](#getting-started)

### Installation

[](#installation)

```
composer require chriha/laravel-api-documentation
```

### Path to your specification

[](#path-to-your-specification)

By default, the OpenAPI YAML specifications should be inside `./resources/api/...`. In this directory, you can create a file for each version, e.g. `v1.yml`, `v2.yml`, `v3.yml` and so on.

### API version info

[](#api-version-info)

Each version (file) will provide an endpoint (e.g. `v1.yml` leads to `/api/v1`) with all the information, specified under the info key:

```
...
info:
  version: "v1.0.1"
  title: "Awesome API"
  contact:
    email: "awesome@api.info.com"
...
```

... will result to the following response body:

```
{
    "version": "v1.0.1",
    "title": "Awesome API",
    "contact": {
        "email": "awesome@api.info.com"
    }
}
```

### Documentation

[](#documentation)

Will be available via the URI `/docs/api/[VERSION]` and the file at `/docs/api/[VERSION]/file`.

Configuration
-------------

[](#configuration)

If you would like to change the default configuration, you can publish and update it to your needs:

```
php artisan vendor:publish --provider="Chriha\ApiDocumentation\ApiDocumentationServiceProvider"
```

Configuration will then be available in `./config/api-documentation.php`.

### Specifications path and naming format

[](#specifications-path-and-naming-format)

You can change the path to your specifications and the format of your files via the `specifications` key in the configuration.

### Changing the middleware

[](#changing-the-middleware)

By default, the documentation uses the `web`-, the API info endpoint the `api`-middleware. You can change this in the configuration by changing the `middleware` key.

### Hiding information

[](#hiding-information)

If you want to hide keys from the info endpoint (e.g. `/api/v1`), you can specify those in the configuration under `specifications.hide` via "dot" notation.

```
    'specifications' => [
        'hide'   => [
            'v1' => [
                'contact.email',
                'description',
            ]
        ],
    ],
```

Development
-----------

[](#development)

### Conventional Commits

[](#conventional-commits)

Please use conventional commits for automated semantic versioning, if you submit your merge request.

### Dry Run Semantic Release

[](#dry-run-semantic-release)

```
npm i @semantic-release/changelog @semantic-release/git @semantic-release/exec -D
GITHUB_TOKEN=YOUR_GITHUB_TOKEN npx semantic-release --dry-run --no-ci
```

Contributing
------------

[](#contributing)

Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on the code of conduct, and the process for submitting pull requests.

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance46

Moderate activity, may be stable

Popularity28

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 57.1% 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.

###  Release Activity

Cadence

Every ~135 days

Recently: every ~281 days

Total

12

Last Release

403d ago

Major Versions

v1.4.0 → v2.0.02022-03-14

PHP version history (5 changes)v1.0.0PHP ^7.2

v1.2.1PHP ^7.2|^8.0

v2.0.0PHP ^8.0|^8.1

v2.0.2PHP ^8.0|^8.1|^8.2|^8.3

v2.1.0PHP ^8.0|^8.1|^8.2|^8.3|^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/0a593d81eb5101c5d9500de7203ccb540930b398f2dc342b0bb10db297cad886?d=identicon)[chriha](/maintainers/chriha)

---

Top Contributors

[![chriha](https://avatars.githubusercontent.com/u/53882?v=4)](https://github.com/chriha "chriha (16 commits)")[![semantic-release-bot](https://avatars.githubusercontent.com/u/32174276?v=4)](https://github.com/semantic-release-bot "semantic-release-bot (12 commits)")

---

Tags

composerlaravelopenapiswagger-documentation

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/chriha-laravel-api-documentation/health.svg)

```
[![Health](https://phpackages.com/badges/chriha-laravel-api-documentation/health.svg)](https://phpackages.com/packages/chriha-laravel-api-documentation)
```

###  Alternatives

[dragon-code/pretty-routes

Pretty Routes for Laravel

10058.7k4](/packages/dragon-code-pretty-routes)[konekt/html

HTML and Form Builders for the Laravel Framework

24403.2k5](/packages/konekt-html)[bjuppa/laravel-blog

Add blog functionality to your Laravel project

483.3k2](/packages/bjuppa-laravel-blog)[laragear/poke

Keep your forms alive, avoid TokenMismatchException by gently poking your Laravel app

2211.5k](/packages/laragear-poke)

PHPackages © 2026

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