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.2.0(1mo ago)118.0k↓42.4%1MITPHPPHP ^8.0|^8.1|^8.2|^8.3|^8.4CI failing

Since Mar 17Pushed 1mo 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 3d ago

READMEChangelog (10)Dependencies (16)Versions (15)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

56

—

FairBetter than 97% of packages

Maintenance89

Actively maintained with recent releases

Popularity28

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor1

Top contributor holds 58.6% 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 ~156 days

Recently: every ~285 days

Total

13

Last Release

58d 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 (17 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

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.6k29.9M146](/packages/laravel-cashier)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k15.1M132](/packages/laravel-pulse)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

77022.3M151](/packages/laravel-mcp)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)

PHPackages © 2026

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