Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Api Doc Bundle Laravel Package

gohiei/api-doc-bundle

gohiei/api-doc-bundle is a PHP package for generating browsable API documentation from your application's routes and annotations. It keeps endpoint references close to the code, making internal or public API docs easier to maintain and share with your team.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit — poor, and mismatched at the framework level. Despite being requested as a Laravel/PHP package, gohiei/api-doc-bundle is a Symfony bundle, not a Laravel package. It is a fork of nelmio/NelmioApiDocBundle, which integrates through Symfony-specific extension points: a Bundle subclass, DependencyInjection compiler passes, HttpKernel event listeners, and Symfony's RouteCollection. Laravel has none of these. There is no ServiceProvider, no Facade, no config/*.php, and no Composer extra.laravel.providers entry, so package auto-discovery will not register anything.

More fundamentally, the package's core value proposition is reading annotations off Symfony controllers and reflecting over the Symfony router to emit an OpenAPI/Swagger document. Laravel's routing (Illuminate\Routing\Route), controller resolution, and middleware pipeline are structurally different. Bridging would mean reimplementing the route-collection adapter and the annotation-reading controller resolver — which is most of the package.

Integration feasibility — low, with a high bridging tax. To make this work inside Laravel you would need to write and own:

  • a service provider that boots a Symfony DI container inside Laravel's container,
  • an adapter mapping Illuminate\Routing\Route to Symfony Route objects for the doc generator,
  • a controller reflector compatible with Laravel's invokable/__invoke and resource controller conventions,
  • a middleware to replace the Symfony kernel.event_listener hooks (UI route, asset serving, JSON endpoint).

That is a bespoke integration layer with no upstream to track. The realistic effort is days-to-weeks of engineering plus indefinite ownership, for a documentation generator.

Technical risk — high, and concentrated in provenance and abandonment.

  • Zero adoption signal: 0 stars, 0 dependents, 0 forks of note. No production usage to infer stability from, no issue history to mine for known breakage.
  • Stale by roughly two framework generations: last release 2019-12-30 places it in the Nelmio v3 / Symfony 3–4 / PHP 7.1–7.4 era. It predates PHP 8 attributes (Nelmio moved annotation→attribute support in v4), Laravel 8+, and Symfony 5/6.
  • Fork provenance is unclear: the repo is named NelmioApiDocBundle under a personal account. We cannot tell from the metadata what was changed, whether upstream security fixes were carried forward, or whether the fork is a rename for packagist squatting. This is a supply-chain review item before any code executes in CI.
  • No security patch path: annotations are parsed and reflected at runtime; any future advisory in doctrine/annotations, symfony/*, or zircote/swagger-php will not be patched here.

Key questions to resolve before any spike:

  1. Is the target application actually Laravel, or is this request a mis-filed Symfony requirement? (If Symfony, evaluate maintained nelmio/api-doc-bundle v4/v5 directly — this fork adds nothing.)
  2. What does this fork change relative to upstream, and is that delta still relevant in 2024+?
  3. Is annotation-based generation a hard requirement, or is OpenAPI-first acceptable? The latter eliminates the dependency entirely.
  4. Which PHP and Laravel versions must be supported, and does anything here install at all on them?
  5. Who owns the integration layer long-term if we proceed?

Recommendation: do not adopt. If the stack is Laravel, the functionally equivalent and maintained options are dedoc/scramble (zero-annotation, reflection-based), knuckleswtf/scribe (doc generation plus human-readable output), darkaonline/l5-swagger (Swagger UI + annotations via zircote/swagger-php), or OpenAPI-first with a checked-in spec and spectacle. If the stack is Symfony, use upstream Nelmio.

Integration Approach

Stack fit. The package fits only a Symfony 3/4 application on PHP 7.x. It does not fit Laravel at any version. Fit score against a modern Laravel codebase: effectively zero.

Compatibility matrix (inferred from the 2019 release date — verify in a spike):

Dimension Likely supported Modern target Status
PHP 7.1 – 7.4 8.1 – 8.3 Incompatible
Symfony 3.4 / 4.x 5.4 / 6.x / 7.x Incompatible
Laravel none (not a Laravel package) 10 / 11 Not applicable
Annotation style Doctrine annotations PHP 8 attributes Legacy
Composer install likely conflicts — Expect dependency hell

Migration path. Two viable routes, neither of which uses this package:

  • If annotation-driven docs are required: migrate to zircote/swagger-php with PHP 8 attributes, wired into Laravel via l5-swagger. Attributes replace annotations one controller at a time, so the migration is incremental and reversible.
  • If the goal is simply "documented API": adopt dedoc/scramble, which requires no annotations at all and derives the spec from Laravel routes, form requests, and API resources. This is the lowest-effort path and the one I would default to.

If someone has already written annotations against this bundle's dialect, they are plain OpenAPI annotations and port cleanly to swagger-php — treat the existing annotations as the asset, not the bundle.

Sequencing, if leadership insists on a spike:

  1. Day 0 — provenance review. Diff the fork against the tagged upstream release it was cut from; confirm license (upstream is MIT) and that no obfuscated or unexpected code was introduced. Block on this.
  2. Day 1 — installability probe. On a throwaway branch at the target PHP/Laravel version, attempt composer require and record the conflict graph. Expect failure; the output is the evidence needed to close the question.
  3. Days 2–3 — parallel bake-off. Timebox a Scramble spike and an l5-swagger spike against one representative controller group. Compare generated spec fidelity, CI runtime, and annotation burden.
  4. Day 4 — decision memo. Recommend the maintained alternative; document why the fork was rejected so the question does not resurface.
  5. Then — roll out incrementally by module, gate the generated spec in CI (diff the OpenAPI file and fail on unintended contract changes).

Do not sequence this as "integrate the bundle, then swap later." The bridging layer is throwaway work that will consume the entire budget before producing a single doc page.

Operational Impact

Maintenance. This is the dominant cost. An unmaintained dependency with zero dependents means the adopter becomes the maintainer — of both the package and the Laravel bridge. Every PHP minor upgrade, every Laravel major, and every security advisory in the transitive tree becomes internal work. Contrast with Scramble or l5-swagger, where upstream absorbs that cost. For a documentation tool, that trade is never justified.

Support. No vendor, no community, no issue backlog to search. Internal engineers debugging a reflection failure in a 2019 codebase will be reading source, not docs. Budget for that.

Scaling. Doc generation is a build-time/CI concern rather than a request-path one, but two scaling notes: (a) annotation parsing plus reflection is memory- and CPU-heavy — on a large API surface expect multi-second generation, so cache the output artifact rather than regenerating per request; (b) if the Symfony UI route is exposed in production, it must be behind auth and excluded from public ingress, since the generated spec is an attack-surface map.

Failure modes to expect, ranked by likelihood:

  1. Composer resolution failure on install — the immediate, blocking failure.
  2. Fatal error on PHP 8 — removed functions, reserved words, deprecated reflection signatures.
  3. Silent route omission — the adapter returns a partial spec; docs look fine but omit endpoints, which is worse than no docs because consumers trust it.
  4. Framework-upgrade breakage with no upstream fix — occurs on every Laravel major.
  5. Unpatched transitive CVE — no upgrade path short of an internal fork.
  6. Autoload/namespace collisions with any other Swagger-annotation consumer in the same app.
  7. CI drift — stale committed spec diverging from actual routes, unnoticed without a diff gate.

Ramp-up. For a team fluent in Symfony internals, understanding the bundle is a day. For a Laravel team, the ramp-up is not learning the package but learning Symfony's DI and routing well enough to write the bridge — roughly a week before the first useful output, all of it non-transferable. The maintained alternatives have hour-scale ramp-up and Laravel-native mental models.

Bottom line for the operating plan: reject the dependency, reallocate the integration budget to a maintained alternative, and invest the saved effort in CI contract-diff gating — that is where the real durability of an API documentation practice lives, not in the generator.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin