dedoc/laravel-api-docs
Generate OpenAPI documentation directly from your Laravel routes and code with a built-in UI for browsing endpoints. Keeps API docs in sync and reduces manual spec maintenance.
Architecture fit: Scramble is a Laravel-native OpenAPI generator that infers a spec directly from routes, controllers, form requests, and Eloquent models — no hand-maintained annotations. It slots into the framework rather than sitting beside it, which is a good fit for a Laravel API codebase that wants documentation to track code automatically. It is a dev/CI-time dependency, not a runtime one, so it does not affect request-path architecture or deployment topology.
Integration feasibility: Low-friction. Installation is a single Composer require plus config publish, and spec exposure is typically a single registered route gated to non-production. The main effort is not wiring it up but validating that the generated document matches what our API actually does and what our consumers expect. The OpenAPI 3.2 support added in v0.13.48 is opt-in (3.1 remains default, emitting 3.1.2), which keeps the upgrade path contained.
Technical risk: The headline risk is the toArray → serializeAs31 serialization change. The release notes scope it to consumers who extended or overrode toArray on Generator-namespace OpenAPI objects; teams using the package as-is are unaffected. Because Scramble is still pre-1.0, this is a reminder that minor version bumps can carry breaking behavior — we should pin versions and review changelogs rather than float. Secondary risks: single-maintainer bus factor, and inference-based generation can silently misdescribe endpoints when type hints or validation rules are ambiguous. OpenAPI 3.2 adoption is also ahead of many downstream tooling consumers.
Key questions:
toArray anywhere in our customization layer, or register custom OpenAPI object extensions?Stack fit: Direct. Scramble assumes standard Laravel idioms (route model binding, form requests, API resources), so a conventional Laravel API gains coverage with near-zero annotation overhead. It does not conflict with runtime concerns like Sanctum/Passport auth, and can coexist with other doc tooling during a comparison period.
Migration path: For a greenfield install this is straightforward — Composer require, publish config, register the docs route behind an environment gate. If we already maintain hand-written or Scribe-generated specs, run Scramble in parallel first, diff the generated document against the incumbent, and close gaps via targeted configuration (type overrides, custom extensions) before retiring the old source of truth.
Compatibility: Confirm PHP and Laravel version floors against our runtime before adoption. The OpenAPI 3.2 output is opt-in, so we should explicitly choose our emitted version rather than inherit defaults, and validate that choice against every downstream consumer. Because 3.2 is new, expect uneven tooling support; defaulting to 3.1 is the safer initial posture.
Sequencing:
toArray overrides or Generator-object customization that this release would break.Maintenance: Active project with a steady release cadence and a recent new contributor, which is a positive signal. However, pre-1.0 status means upgrade reviews are mandatory rather than routine; budget recurring time each cycle to read changelogs and re-validate the generated spec. Treat the version pin as load-bearing.
Support: Community-supported OSS. Issue triage depends on maintainer bandwidth, and the project appears centered on a small number of maintainers — a real bus-factor consideration for a documentation pipeline. We should be prepared to self-diagnose inference problems and, if needed, fork or pin rather than assume upstream responsiveness.
Scaling: Generation is build/CI-time, so it does not add production latency. Cost scales with route and model surface area; large APIs will see slower generation, and this release's performance work ("optimize self-out performance") is a welcome incremental improvement. Cache or artifact the generated spec in CI and avoid regenerating per request. Memory and time should be monitored as the route count grows.
Failure modes:
toArray silently stop being applied after this release rather than erroring loudly.Ramp-up: Low for the default happy path — most Laravel engineers can install and get a usable spec within an afternoon. Moderate for teams needing customization (custom type mappings, extensions, tag hierarchy, auth scheme tuning), where understanding of Scramble's inference internals and the OpenAPI object model is required. Plan for one engineer to own the documentation pipeline and the upgrade-review process so the bus factor stays internal.
How can I help you explore Laravel packages today?