darkaonline/l5-swagger
L5-Swagger packages swagger-php and Swagger UI for Laravel, letting you generate and serve OpenAPI/Swagger documentation for your API with minimal setup and a simple config file.
swagger-php, the spec lives as PHP attributes next to the controllers. That couples docs to implementation — great for velocity, worse for designing an API before building it. Use it to decide where in the lifecycle your team writes specs./v2 decisions.Adopt when:
Look elsewhere when:
dedoc/scramble-style route introspection is a better fit if the team won't maintain attributes.Risk checks before committing: single-maintainer concentration (bus factor), a major-version cadence that tracks Laravel majors and requires migration work (the v10 removal of Doctrine annotations is precedent), and a history of security patches in the UI assets — pin versions and track advisories. Note the "0 dependents" figure is a data artifact, not a signal; the download badge tells the real adoption story.
To executives: This is a free, MIT-licensed Laravel package that publishes a live, interactive API reference from the code we already write. It replaces a five-figure developer-portal contract for our current stage and shrinks partner onboarding and API support load. The output is standard OpenAPI, so we are not locked in — if we outgrow it, the spec moves with us.
To engineering: It's a thin wrapper over swagger-php and swagger-ui — no custom spec dialect, no runtime dependency in the request path. Spec generation is a build-time artisan command; the UI is a single route you can restrict to non-production. Configuration is one published config file. Cost is annotation discipline in controllers; benefit is a spec that can't silently drift, plus auth-aware try-it-out. Upgrades are small, versioned, and tied to Laravel majors — budget a short maintenance window per Laravel upgrade.
To security/ops: No external service, no data leaves the stack. Gate the docs route by environment, pin the package version, and monitor the changelog — the project has responded quickly to path-traversal and UI CVEs historically.
How can I help you explore Laravel packages today?