Download the PHP package sdekkers/compass without Composer
On this page you can find all versions of the php package sdekkers/compass. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download sdekkers/compass
More information about sdekkers/compass
Files in sdekkers/compass
Download sdekkers/compass
More information about sdekkers/compass
Files in sdekkers/compass
Vendor sdekkers
Package compass
Short Description Zero-config OpenAPI documentation generator for Laravel modular applications
License ISC
Homepage https://github.com/SDekkers/Compass
Package compass
Short Description Zero-config OpenAPI documentation generator for Laravel modular applications
License ISC
Homepage https://github.com/SDekkers/Compass
Please rate this library. Is it a good library?
Informations about the package compass
Compass 🧭
Zero-config OpenAPI documentation for Laravel. No annotations. No docblocks. Just reads your code.
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
- PHP 8.4+
- Laravel 11 or 12
Installation
Quick Start
Your openapi.yaml and openapi.json are now in storage/app/compass/. Visit /docs to see the Swagger UI.
Configuration
Publish the config file:
Key options in config/compass.php:
| Option | Description |
|---|---|
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
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:apiandauth:sanctummap to security schemes - Grouping — Controllers in
App\Modules\{Name}\Controllers\are automatically tagged
Validation Rule Mapping
| Laravel Rule | OpenAPI |
|---|---|
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
Please see CONTRIBUTING.md for details.
License
The MIT License (MIT). Please see LICENSE for more information.
All versions of compass with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.4
illuminate/support Version ^11.0|^12.0|^13.0
illuminate/routing Version ^11.0|^12.0|^13.0
symfony/yaml Version ^7.0
illuminate/support Version ^11.0|^12.0|^13.0
illuminate/routing Version ^11.0|^12.0|^13.0
symfony/yaml Version ^7.0
The package sdekkers/compass contains the following files
Loading the files please wait ...