L5-Swagger is a Laravel wrapper package that packages swagger-php and swagger-ui into a Laravel-friendly form so a project can generate and serve an OpenAPI or Swagger specification from annotations without wiring those tools together by hand.
What it is
L5-Swagger is a PHP package maintained by DarkaOnLine that integrates OpenAPI and Swagger tooling into Laravel applications. It is published on Packagist as DarkaOnLine/L5-Swagger and is licensed under MIT. The project is a wrapper rather than a specification engine: it bundles swagger-php, which reads annotations in application code and produces the specification document, together with swagger-ui, which renders that document as browsable documentation. Its README states the disclaimer plainly — the actual Swagger spec is beyond the scope of this package, and all L5-Swagger does is package swagger-php and swagger-ui in a Laravel-friendly fashion and make them easy to serve.
The concrete problem it solves is the gap between a Laravel application and a published API specification. Teams that want annotated OpenAPI output and a hosted documentation interface would otherwise need to install swagger-php themselves, decide where generated files live, build routes or controllers to serve the UI, and keep configuration aligned across environments. L5-Swagger replaces that manual assembly with a Laravel package that installs through Composer, exposes the tooling through framework conventions, and lets the resulting documentation be served from the application itself.
Key capabilities
- Wraps
swagger-php for annotation-driven generation of OpenAPI and Swagger specification documents from Laravel application code.
- Serves
swagger-ui so the generated specification renders as interactive, browsable API documentation.
- Supports OpenAPI annotations as a documented topic, alongside the older Swagger specification format.
- Documents a workflow for Using Swagger UI with Passport, covering token-based authentication in the generated documentation.
- Provides Installation & Configuration instructions through the project wiki rather than the README.
- Publishes Migration Guides, so projects moving between package versions have a documented upgrade path.
- Maintains a Change Log in the wiki alongside general Tips for use.
Who uses it and how
- Laravel teams that treat the API specification as part of the codebase, annotating controllers and models so the document regenerates with the application.
- Projects exposing a documented HTTP API to external consumers or partner integrators, where a hosted UI reduces hand-written reference work.
- Applications using Laravel Passport for OAuth-style authentication, following the wiki page on serving Swagger UI with Passport so the documentation can authorize requests.
- Maintainers who upgrade the package across major versions, using the published Migration Guides and Change Log to track breaking changes.
- Contributors and self-hosters who follow the repository through Packagist download counts and the project's test-configuration build status.
Getting started
Install the package with Composer as DarkaOnLine/L5-Swagger, then follow the Installation & Configuration page in the project wiki to publish and adjust the package configuration. The README directs all setup detail to that wiki rather than providing inline instructions.
How it compares
No list of paid products this package replaces is provided in the facts, and no directly comparable registry entries are named either; the only other tools named are swagger-php and swagger-ui, which L5-Swagger wraps rather than competes with. On the evidence available, it stands alone in this registry as a Laravel-specific integration layer for those two upstream projects.
When to use it — and when not to
Choose L5-Swagger when the stack is Laravel and the goal is to generate and serve OpenAPI or Swagger documentation from annotations inside the application, accepting that the package is an integration layer and that authoring the specification itself remains the job of swagger-php. Do not choose it for non-Laravel PHP projects, where the underlying swagger-php and swagger-ui packages would be used directly. Note the honest limitations: the README is sparse and defers nearly all operational detail to the wiki, the project carries 19 open issues, and anyone evaluating it should confirm that the wiki's installation and migration guidance matches their Laravel version before committing.