pedrotroller/api-doc
Pedrotroller/api-doc helps Laravel developers generate and serve API documentation directly from their application, turning routes and annotations into browsable reference docs that stay in sync with the code. Lightweight and easy to integrate.
Architecture fit — poor, with a category mismatch to resolve first. Despite the brief describing this as a "Laravel/PHP package," pedrotroller/api-doc is a Symfony bundle that extends NelmioApiDocBundle v2.x. It hooks into Nelmio's annotation-driven extractor pipeline and Symfony's translator service to emit localized description/summary fields into generated API docs. It assumes Symfony's DI container, event dispatcher, and Translation component — none of which map onto Laravel's container, routing, or localization model. Before any evaluation is actionable, confirm whether the target application is actually Laravel or Symfony; if Laravel, this package is architecturally out of scope.
Integration feasibility — low. Adopting it means either (a) running a hybrid Symfony/Laravel stack (not realistic), or (b) reading the package as a reference implementation and porting its translation-decorator pattern to the actual doc generator in use (Scramble, Scribe, L5-Swagger, or zircote/swagger-php on Laravel; NelmioApiDocBundle v4/v5 with a custom DescriberInterface or ModelDescriber decorator on Symfony). The porting surface is small — the package is a thin set of decorators/wrappers — so the cost is measured in hours, not weeks.
Technical risk — high, concentrated in abandonment and version skew.
^2.x, which is EOL. Nelmio v3 (2017) and v4/v5 replaced the annotation extractor with swagger-php, removing the extension points this package relies on.^5.5|^7.0 and Symfony ^2.3|^3.0 constraints — direct Composer conflicts with PHP 8.x, Symfony 5+/6+/7, and every current Laravel release.Key questions for the sponsor:
Stack fit. Not viable as a drop-in on Laravel 9–12 or Symfony 5+. Viable only on a legacy Symfony 2.8/3.x application already running NelmioApiDocBundle v2 — a shrinking population — and even then only as a pinned, vendored dependency you accept ownership of.
Recommended path: do not install; re-implement the pattern.
paths.*.description and substitutes from lang/{locale}/api.php), or via Scramble/Scribe's documentation hooks. This preserves the capability while dropping the dependency.Describer services with a translator-aware wrapper — the same conceptual move as this package, against a supported upstream.nelmio/api-doc-bundle:^2.13 and this package, vendor-fork it into the repo, and schedule migration off it.Compatibility matrix to verify before committing: PHP constraint, symfony/framework-bundle constraint, nelmio/api-doc-bundle constraint, and whether the annotation reader (doctrine/annotations vs. sensio/framework-extra-bundle) is still resolvable.
Sequencing.
openapi.en.json, openapi.fr.json at build time) — cheaper, cache-friendly, and avoids runtime translation entirely.Maintenance. Effectively unmaintained upstream and here. Every future PHP or framework upgrade is a manual compatibility patch you own. Budget a recurring line item — small per incident, but indefinite. Treat the codebase as an internal fork from day one.
Support. No community, no maintainer response, no dependents to learn from. Internal documentation of why the translation decorator exists is mandatory, because the original rationale lives only in a 2016 commit history.
Scaling. Throughput is a non-issue — documentation generation is a build-time, low-QPS workload. The scaling cost is organizational: adding a locale means adding a catalog, and every new endpoint must ship with descriptions in N locales or silently regress to fallback text. That is a process burden on every API-contributing team, and it is where the real TCO sits.
Failure modes to design against.
doctrine/annotations.Ramp-up. The package itself is small and quick to read — a competent PHP engineer will understand it in under a day. The surrounding knowledge (Nelmio v2 internals, Symfony 2/3 annotation conventions, 2016-era Composer constraints) is legacy and increasingly hard to hire for; that, not the code, is the ramp-up cost. A developer familiar with modern OpenAPI tooling will need explicit context transfer to work on a legacy Nelmio v2 pipeline.
Bottom line for the sponsor. The capability — localized API documentation — is legitimate and worth having. This package is not the vehicle: it is abandoned, mis-scoped for a Laravel stack, and pinned to an EOL upstream. Recommend a one-day spike to port the translation-decorator pattern onto the current generator, and record this package as a design reference rather than a dependency.
How can I help you explore Laravel packages today?