PHPackages                             sdekkers/compass - 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. sdekkers/compass

ActiveLibrary[API Development](/categories/api)

sdekkers/compass
================

Zero-config OpenAPI documentation generator for Laravel modular applications

v0.2.1(2mo ago)0664↓30.4%ISCPHPPHP ^8.4CI passing

Since Feb 20Pushed 1mo agoCompare

[ Source](https://github.com/SDekkers/Compass)[ Packagist](https://packagist.org/packages/sdekkers/compass)[ Docs](https://github.com/SDekkers/Compass)[ RSS](/packages/sdekkers-compass/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (10)Versions (7)Used By (0)

Compass 🧭
=========

[](#compass-)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d3a832dd191b906efb00c45ac1d0762d7128a18380161d181ef8ea937072c072/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7364656b6b6572732f636f6d706173732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sdekkers/compass)[![PHP Version](https://camo.githubusercontent.com/e96994042b13137ce1cb2c15c0edb619dbd40735af6085148a015c409c63e6b2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7364656b6b6572732f636f6d706173732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sdekkers/compass)[![License](https://camo.githubusercontent.com/938c38e7b8ae53571dca40c181a644d3a6ee514d0bf846a69931bfe9346d4000/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7364656b6b6572732f636f6d706173732e7376673f7374796c653d666c61742d737175617265)](LICENSE)

**Zero-config OpenAPI documentation for Laravel.** No annotations. No docblocks. Just reads your code.

Features
--------

[](#features)

- 🔍 Automatic OpenAPI 3.0 spec generation from Laravel routes
- 📋 Schema extraction from FormRequest validation rules
- 📦 Response schemas from JsonResource classes
- 🔐 Auth detection from middleware (Passport, Sanctum, Bearer)
- 🏷️ Module-based route grouping via controller namespaces
- 🖥️ Built-in Swagger UI at `/docs`
- 📄 YAML and JSON output

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

[](#requirements)

- PHP 8.4+
- Laravel 11 or 12

Installation
------------

[](#installation)

```
composer require sdekkers/compass
```

Quick Start
-----------

[](#quick-start)

```
php artisan compass:generate
```

Your `openapi.yaml` and `openapi.json` are now in `storage/app/compass/`. Visit `/docs` to see the Swagger UI.

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

[](#configuration)

Publish the config file:

```
php artisan vendor:publish --tag=compass-config
```

Key options in `config/compass.php`:

OptionDescription`title`API documentation title`version`API version string`servers`Server URLs for the spec`routes.prefixes`Route prefixes to include (default: `['api']`)`routes.exclude_patterns`Glob patterns to exclude`grouping.enabled`Auto-group by module namespace`ui.enabled`Enable/disable Swagger UI`ui.path`URL path for Swagger UI (default: `docs`)How It Works
------------

[](#how-it-works)

Compass inspects your Laravel application and extracts:

- **Routes** — HTTP method, URI, parameters, and middleware from the router
- **Request validation** — FormRequest `rules()` are mapped to OpenAPI request body schemas
- **Response schemas** — JsonResource `toArray()` keys become response schemas
- **Authentication** — Middleware like `auth:api` and `auth:sanctum` map to security schemes
- **Grouping** — Controllers in `App\Modules\{Name}\Controllers\` are automatically tagged

### Validation Rule Mapping

[](#validation-rule-mapping)

Laravel RuleOpenAPI`string``{type: "string"}``integer``{type: "integer"}``boolean``{type: "boolean"}``email``{type: "string", format: "email"}``uuid``{type: "string", format: "uuid"}``date``{type: "string", format: "date"}``max:255``{maxLength: 255}``min:1``{minimum: 1}``in:a,b,c``{enum: ["a","b","c"]}``nullable``{nullable: true}`Contributing
------------

[](#contributing)

Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details.

License
-------

[](#license)

The MIT License (MIT). Please see [LICENSE](LICENSE) for more information.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance87

Actively maintained with recent releases

Popularity19

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~5 days

Total

6

Last Release

61d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f1582d13b409f8c16202a3f56415f90b2b4af1bc29e8cab872aba26f6d12075?d=identicon)[SDekkers1](/maintainers/SDekkers1)

---

Top Contributors

[![SDekkers](https://avatars.githubusercontent.com/u/913981?v=4)](https://github.com/SDekkers "SDekkers (3 commits)")

---

Tags

apilaraveldocumentationswaggeropenapi

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/sdekkers-compass/health.svg)

```
[![Health](https://phpackages.com/badges/sdekkers-compass/health.svg)](https://phpackages.com/packages/sdekkers-compass)
```

###  Alternatives

[darkaonline/l5-swagger

OpenApi or Swagger integration to Laravel

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

OpenApi or Swagger integration to Lumen

3372.3M3](/packages/darkaonline-swagger-lume)

PHPackages © 2026

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