PHPackages                             wadakatu/laravel-spectrum - 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. wadakatu/laravel-spectrum

ActiveLibrary[API Development](/categories/api)

wadakatu/laravel-spectrum
=========================

Zero-annotation OpenAPI/Swagger documentation generator for Laravel - automatic API docs from your existing code

v1.1.3(2mo ago)156[4 PRs](https://github.com/wadakatu/laravel-spectrum/pulls)MITPHPPHP ^8.2CI passing

Since Jul 7Pushed 1mo agoCompare

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

READMEChangelog (10)Dependencies (15)Versions (51)Used By (0)

Laravel Spectrum
================

[](#laravel-spectrum)

 [![Laravel Spectrum Banner](/assets/banner.svg)](/assets/banner.svg)

 [![Tests](https://github.com/wadakatu/laravel-spectrum/workflows/Tests/badge.svg)](https://github.com/wadakatu/laravel-spectrum/actions) [![Code Coverage](https://camo.githubusercontent.com/00e6b2f85548b902075e8129d3653b2de60e9f1a9f4170908df2674a8a4a83f1/68747470733a2f2f636f6465636f762e696f2f67682f776164616b6174752f6c61726176656c2d737065637472756d2f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/wadakatu/laravel-spectrum) [![Latest Stable Version](https://camo.githubusercontent.com/fedddb20a02da16845e7f57277cc41b4eca14aaada7101a9b39ab514e8c6c0ce/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f776164616b6174752f6c61726176656c2d737065637472756d)](https://packagist.org/packages/wadakatu/laravel-spectrum) [![Total Downloads](https://camo.githubusercontent.com/e13ce2338e5d713d0f1d8de5e89d6dcde283cbd127f33854add0b88ee2fab472/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f776164616b6174752f6c61726176656c2d737065637472756d)](https://packagist.org/packages/wadakatu/laravel-spectrum) [![License](https://camo.githubusercontent.com/0b9abcda6baab8322e4703d796b363835068e8dc3169ad5be243a68609664075/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f776164616b6174752f6c61726176656c2d737065637472756d)](https://packagist.org/packages/wadakatu/laravel-spectrum)

 **Zero-annotation OpenAPI documentation generator for Laravel**
 *Generate complete API docs from your existing code in seconds. No annotations required.*

 [Documentation](https://wadakatu.github.io/laravel-spectrum/) • [Quick Start](https://wadakatu.github.io/laravel-spectrum/docs/quick-start) • [Compare](https://wadakatu.github.io/laravel-spectrum/docs/comparison)

---

The Problem
-----------

[](#the-problem)

```
// ❌ Traditional approach: Annotations everywhere
/**
 * @OA\Post(
 *     path="/api/users",
 *     @OA\RequestBody(
 *         @OA\JsonContent(
 *             @OA\Property(property="name", type="string"),
 *             @OA\Property(property="email", type="string", format="email"),
 *             // ... 50 more lines of annotations
 *         )
 *     ),
 *     @OA\Response(response="200", description="Success")
 * )
 */
public function store(StoreUserRequest $request) { ... }
```

**With Laravel Spectrum: Zero annotations needed.** Your existing `FormRequest` and `Resource` classes are your documentation.

---

Quick Start (30 seconds)
------------------------

[](#quick-start-30-seconds)

```
# Install
composer require wadakatu/laravel-spectrum --dev

# Generate OpenAPI documentation
php artisan spectrum:generate

# View in browser (HTML, default: Swagger UI)
php artisan spectrum:generate --format=html
# Or choose a viewer
php artisan spectrum:generate --format=html --viewer=elements
# Open: storage/app/spectrum/openapi.html
```

**That's it.** Full OpenAPI 3.1 documentation generated from your existing code.

---

What Gets Analyzed Automatically
--------------------------------

[](#what-gets-analyzed-automatically)

Your CodeGenerated Documentation`FormRequest::rules()`Request body schemas with validation`$request->validate([...])`Inline validation rules`API Resources`Response schemasAuth middleware (`auth:sanctum`)Security schemesRoute parameters (`{user}`)Path parameters with types`@deprecated` PHPDocDeprecated operation flags---

Key Features
------------

[](#key-features)

### Real-time Documentation

[](#real-time-documentation)

```
php artisan spectrum:watch
# Browser auto-refreshes when you change code
```

### Built-in Mock Server

[](#built-in-mock-server)

```
php artisan spectrum:mock
# Frontend team can develop without waiting for backend
```

### Export to API Clients

[](#export-to-api-clients)

```
php artisan spectrum:export:postman    # Postman collection
php artisan spectrum:export:insomnia   # Insomnia workspace
php artisan spectrum:sdk typescript    # Type-safe SDK client
```

### Validate OpenAPI Spec

[](#validate-openapi-spec)

```
php artisan spectrum:validate storage/app/spectrum/openapi.json
php artisan spectrum:validate --generate --strict
```

### Detect API Breaking Changes

[](#detect-api-breaking-changes)

```
php artisan spectrum:diff docs/openapi-v1.json docs/openapi-v2.json
php artisan spectrum:diff --against=last --format=json
php artisan spectrum:version-compare docs/openapi-v1.json docs/openapi-v2.json --migration-guide
```

### High Performance

[](#high-performance)

- Parallel processing for large codebases
- Incremental generation (only changed files)
- Smart caching

---

Why Laravel Spectrum?
---------------------

[](#why-laravel-spectrum)

Laravel SpectrumSwagger-PHPScribeZero annotations✅❌PartialSetup time**30 sec**Hours~30 minFormRequest detection✅❌✅Mock server✅❌❌Live reload✅❌❌Postman/Insomnia export✅❌✅OpenAPI 3.1✅✅❌---

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 11.x or 12.x

Compliance Check (Demo App Matrix)
----------------------------------

[](#compliance-check-demo-app-matrix)

Use the bundled demo apps to verify OpenAPI 3.0/3.1 compliance in one run:

```
./demo-app/check-openapi-compliance.sh
```

Details: `demo-app/README.md`

---

Documentation
-------------

[](#documentation)

📖 **[Full Documentation](https://wadakatu.github.io/laravel-spectrum/)**

- [Installation](https://wadakatu.github.io/laravel-spectrum/docs/installation)
- [Configuration](https://wadakatu.github.io/laravel-spectrum/docs/config-reference)
- [CLI Commands](https://wadakatu.github.io/laravel-spectrum/docs/cli-reference)
- [Comparison with Other Tools](https://wadakatu.github.io/laravel-spectrum/docs/comparison)

---

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

[](#contributing)

Contributions are welcome! Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for details. For mutation testing, run `composer infection` (full run with CI-aligned MSI thresholds).

License
-------

[](#license)

Laravel Spectrum is open-source software licensed under the [MIT license](./LICENSE).

---

 [ ![Star on GitHub](https://camo.githubusercontent.com/782f1b7626a1d016ccd1c932ae12e81eaf67cac6f330b28502ef208cf126c60d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f776164616b6174752f6c61726176656c2d737065637472756d3f7374796c653d736f6369616c) ](https://github.com/wadakatu/laravel-spectrum)

 Made with ❤️ by [wadakatu](https://github.com/wadakatu)

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance88

Actively maintained with recent releases

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 92.3% 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 ~8 days

Total

28

Last Release

86d ago

Major Versions

v0.2.2-beta → v1.0.02026-01-04

PHP version history (2 changes)v0.0.1-alphaPHP ^8.1

v0.2.2-betaPHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/6fc976536b6b21ad39ca38269c6c59eceabc5fd57d6627e6742279cff53c387a?d=identicon)[wadakatu](/maintainers/wadakatu)

---

Top Contributors

[![wadakatu](https://avatars.githubusercontent.com/u/72595463?v=4)](https://github.com/wadakatu "wadakatu (445 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (30 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (7 commits)")

---

Tags

apiapi-documentationautomationdeveloper-toolsdocumentation-generatorlaravelmock-serveropenapiphprest-apiswaggerzero-annotationapilaraveldocumentationswaggeropenapigeneratorREST APIautomaticapi-documentationmock-serverzero-annotationswagger-alternativeno-annotation

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/wadakatu-laravel-spectrum/health.svg)

```
[![Health](https://phpackages.com/badges/wadakatu-laravel-spectrum/health.svg)](https://phpackages.com/packages/wadakatu-laravel-spectrum)
```

###  Alternatives

[darkaonline/l5-swagger

OpenApi or Swagger integration to Laravel

2.9k34.0M112](/packages/darkaonline-l5-swagger)

PHPackages © 2026

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