dedoc/scramble
Scramble generates OpenAPI 3.1.0 documentation for your Laravel API automatically from your code, with no PHPDoc annotations required. Just install it to get a docs UI at /docs/api and a JSON spec at /docs/api.json, always kept up to date with your API.
Architecture fit. Scramble is an application-level Laravel package, not a library other code depends on. Fit is therefore judged on how cleanly it attaches to an existing Laravel service: composer require dedoc/scramble, auto-discovered service provider, and two routes registered by default (/docs/api UI, /docs/api.json OpenAPI document), restricted to the local environment unless a viewApiDocs gate is defined. That is an unusually small architectural footprint — no base controller, no route middleware changes, no annotation layer threaded through the codebase. For a TPM this matters because adoption cost is bounded and reversible; removal is a composer remove.
Integration feasibility. High. The core value proposition is documentation derived from code that already exists: route definitions, FormRequest validation rules, API Resource classes, Eloquent models and casts, return types and PHPDoc. Release notes through 0.13.x show steady widening of that inference surface — closure routes, paginator transformation, paginationInformation, union types, @deprecated/@hidden, operationId via attributes, Rule::when/requiredIf/regex. Laravel 11/12/13 compatibility is explicitly tracked. The practical constraint is that inference quality is a function of codebase discipline: typed returns, FormRequests, API Resources and explicit casts produce good output; magic arrays, dynamic response shaping, and custom validation produce gaps.
Technical risk.
Key questions.
local and wrong for production contract governance.viewApiDocs gate, and is there any path by which /docs/api becomes reachable in staging or production unauthenticated?Stack fit. Strong for a conventional Laravel service: FormRequests for input, API Resources for output, Eloquent for models, typed controller returns. Where the codebase already follows those idioms, Scramble is close to zero-effort. Where it doesn't, the honest framing is that Scramble doubles as a lint for contract clarity — endpoints that document poorly are usually endpoints that are hard to reason about anyway. It also fits naturally alongside existing PHPStan/Larastan static analysis, since both reward the same type precision.
Migration path. The realistic incumbent is Scribe or l5-swagger, both annotation-driven. Do not do a big-bang cutover. Run Scramble in parallel on a branch, export both documents, and diff them endpoint by endpoint. Every discrepancy is either an inference gap (fix in code or annotate) or a stale annotation in the legacy docs (delete it). Retire annotations endpoint-group by endpoint-group once parity is confirmed. The migration is therefore a documentation-debt cleanup project with a tool attached, not a tooling swap — scope it accordingly.
Compatibility. Laravel 11–13 and PHP 8.x are the comfortable zone; older Laravel versions should be validated against the specific 0.13.x release. The two compatibility surfaces that actually bite are (a) OpenAPI 3.1 consumers downstream, and (b) the package's own inference against your Laravel version's PHPDoc conventions — 0.13.0's "full type inference" leans directly on Laravel 11/12's improved annotations, so older framework versions yield proportionally weaker output.
Sequencing.
local.Maintenance. Low ongoing code maintenance, non-trivial ongoing upgrade maintenance. Budget for reading every changelog between pinned versions and re-diffing the exported document. Pin to a specific patch version, not ^0.13, precisely because a patch can correct inference and change the published contract. Assign one owner for the package and the exported artifact.
Support. Community and maintainer-led; docs live at scramble.dedoc.co and are good, but this is not a commercially supported dependency. For a tool that emits a customer-facing API contract, that means internal ownership of correctness is mandatory — you cannot escalate. The skill/reference material shipped with the package is a genuine mitigation; point engineers at it before filing issues.
Scaling. Two dimensions. Route volume: the analyzer walks routes, controllers, models and vendor PHPDoc; on a large API this becomes a measurable build-time cost. Prefer export-at-build-time over on-demand generation at request time, and cache the artifact. Organizational: as the number of teams contributing endpoints grows, the "code is the contract" model means every team's coding hygiene becomes a docs quality issue. That is a governance concern, not a technical one, and it needs a written convention per endpoint group.
Failure modes to instrument for.
local because the gate was never configured. Treat as a security finding, not a config nit.Ramp-up. Near-zero for developers — there is nothing new to learn to get docs. The learning investment is in the opposite direction: teams must internalize that the documentation is only as good as their type discipline, and must know the escape hatches (Endpoint/QueryParameter attributes, @hidden, @deprecated, config for ignored classes and query-flattening) for the cases inference cannot reach. A half-day enablement session plus a one-page internal convention covers it. Overall: attractive at a score in the mid-50s — high leverage, low blast radius, but pre-1.0 and single-maintainer, so adopt deliberately with pinning, CI diffing, and a named owner rather than as a fire-and-forget convenience.
How can I help you explore Laravel packages today?