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
Laravel Swagger Api

Laravel Swagger Api Laravel Package

hcesrl/laravel-swagger-api

Laravel Swagger API generates interactive OpenAPI/Swagger documentation for your Laravel API directly from your routes, controllers, and annotations—no separate spec files to maintain. Browse endpoints, try requests, and keep docs in sync with your code.

View on GitHub
Deep Wiki
Context7

A Laravel integration with Swagger UI.

Frequently asked questions about Laravel Swagger Api
How do I install hcesrl/laravel-swagger-api in a Laravel project?
Install it with Composer using composer require hcesrl/laravel-swagger-api, ideally with a caret constraint such as ^1.4 so you absorb patch fixes without an unplanned 2.0 jump. Because v1.4.0 added Laravel Vapor support, check the changelog and composer.json before committing to confirm there are no undocumented changes to service provider registration or config publishing. If documentation output sits on a critical path, pin an exact version until you have validated it in a sandbox branch.
Which Laravel and PHP versions does laravel-swagger-api support?
The package targets Laravel applications and the v1.4.0 release includes a style and PHPDoc pass, which often coincides with a formalized minimum PHP version floor in composer.json. Read composer.json directly rather than inferring constraints from release notes. If you deploy on Laravel Vapor, confirm the declared PHP constraint matches the runtime image and Lambda layer you use.
Does laravel-swagger-api work with Laravel Vapor and AWS Lambda?
Laravel Vapor support was added in v1.4.0, so the package is now positioned for serverless deployments rather than being Vapor-native from inception. Treat that as a claim to verify rather than a guarantee of parity: exercise the package on a non-production Vapor environment before relying on it. Pay attention to Lambda's read-only filesystem outside /tmp, ephemeral local state, cold starts, and the 15-minute invocation ceiling.
Do I need to write a separate OpenAPI spec file for my Laravel API?
No. The package generates interactive OpenAPI/Swagger documentation directly from your routes, controllers, and annotations, so there is no standalone spec file to maintain by hand. That keeps your docs in sync as your code changes. If you already maintain a hand-written spec, you will need to decide whether to migrate to annotation-driven generation or keep the two sources aligned.
Can I try out API requests directly from the generated Swagger UI?
Yes. The package integrates Swagger UI, so you can browse endpoints, inspect request and response shapes, and send test requests from the browser. This makes it useful for local development, QA, and internal API reviews. Be careful about exposing interactive docs publicly in production, since the UI can issue real requests against your API.
Is it safe to expose the Swagger UI in production with this package?
The package itself renders interactive documentation that can dispatch real requests, so the exposure question is about access control rather than the package. Restrict the docs routes behind authentication, IP allowlisting, or a non-production environment gate. If you deploy on Vapor, remember that any caching or generated artifacts must survive Lambda's ephemeral filesystem.
Does laravel-swagger-api write files to storage or rely on local cache?
That is the key thing to verify for serverless deployments. Lambda mounts a read-only filesystem outside /tmp and does not preserve local state between invocations, so any package that assumes a persistent disk will break silently. Check whether the generated documentation is built per request or cached to storage, and confirm the local cache and session drivers are not required on the Vapor path.
How does laravel-swagger-api compare to other Laravel Swagger packages?
Its distinguishing claim is generating documentation from routes, controllers, and annotations without a separate spec file to maintain, which is convenient if you want docs to track your code automatically. Established alternatives such as l5-swagger take a more spec-file-centric approach, which can be preferable if you need strict, version-controlled OpenAPI artifacts. Evaluate both against your team's workflow and your deployment targets rather than on feature checklists alone.
How do I test that the generated Swagger documentation is correct?
Install into a sandbox branch and exercise every documented endpoint through the Swagger UI to confirm paths, parameters, and response shapes match reality. If you run on Vapor, run the same checks separately on the Lambda path, since the added execution branch must be validated independently of conventional hosting. Note that the release notes do not state whether CI covers the Vapor path, so treat it as unverified until you see evidence.
Is hcesrl/laravel-swagger-api actively maintained and what license does it use?
The v1.4.0 release includes a style and PHPDoc cleanup alongside Vapor support, which suggests active stewardship, but the maintainer's release cadence and issue responsiveness are not proven by a single release. Review the repository history on GitHub to judge cadence before adopting. The license is not stated in the provided overview, so confirm it in composer.json and verify it fits your distribution model.
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.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource