Scramble

Modern Laravel OpenAPI (Swagger) documentation generator with no PHPDoc annotations required

Tool
Composer
vv0.13.41
2,176stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
88/100Excellent
Development Activity96
Maintenance100
Community60
Maturity56
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
86/100Excellent
Architecture88
Code Quality86
Innovation87
Learning Curve82

Scramble is a Laravel API documentation generator that produces OpenAPI 3.1.0 documents automatically from your application’s code, without requiring you to write PHPDoc annotations. It analyzes controllers, routes, form requests, and return types to infer request parameters and response shapes.

After installation it exposes a documentation UI and a JSON OpenAPI endpoint, keeping docs continuously in sync with the code so your API always has up-to-date, trustworthy documentation. Its philosophy is to let you focus on code rather than maintaining separate annotations that drift out of date.

What You Get

  • Automatic OpenAPI 3.1.0 document generation from Laravel code
  • A built-in documentation UI at /docs/api and a JSON spec at /docs/api.json
  • Type inference from controllers, form requests, resources, and return types
  • Console commands to export the OpenAPI document
  • Extension points for transformers and custom type handling

Common Use Cases

  • Generating always-current API docs for a Laravel backend
  • Exposing an interactive API reference to frontend and mobile teams
  • Exporting an OpenAPI spec for client SDK generation
  • Documenting APIs without maintaining PHPDoc annotations

Under The Hood

Architecture - Scramble walks your Laravel routes and controllers, using a type-inference engine and an OpenAPI visitor layer (AbstractOpenApiVisitor.php, ContextReferences, DocumentTransformers) to build an OpenAPI document from static analysis of request classes, resources, and return types; a CacheableGenerator caches results, Console commands export the spec, and Configuration/Attributes let you tune behavior.

Tech Stack - A PHP package built for Laravel and distributed via Composer, leaning on nikic/php-parser-style AST analysis and Laravel’s service container, with a service provider that registers the docs UI and JSON routes.

Code Quality - The src tree is organized into focused namespaces (Configuration, Console, Contracts, DocumentTransformers, Enums, Attributes), and the project shows very active, consistently maintained development with frequent releases, indicating a well-structured and healthy codebase.

API Design - The developer experience is deliberately low-effort: install, and documentation appears at /docs/api with an OpenAPI JSON at /docs/api.json, no annotations needed. Customization is available through configuration, attributes, and document transformers for cases where inference needs guidance.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search