Weave Code
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

Swagger Php Laravel Package

zircote/swagger-php

swagger-php generates OpenAPI 3.0/3.1/3.2 documentation from your PHP 8.2+ code using attributes (preferred) or optional Doctrine annotations. Use it via CLI or programmatically, with helpful error reporting and a full documentation site.

View on GitHub
Deep Wiki
Context7

layout: home hero: name: Swagger-PHP tagline: Generate OpenAPI documentation for your RESTful API. actions: - theme: brand text: User Guide → link: /guide/ features:

  • title: OpenAPI conformant details: Generate OpenAPI documents in version 3.0 or 3.1.
  • title: Document your API inside PHP source code details: Using swagger-php lets you write the API documentation inside the PHP source files which helps keeping the documentation up-to-date.
  • title: Annotation and Attribute support details: Annotations can be either docblocks or PHP 8.1 attributes.

1. Install with composer:

> composer require zircote/swagger-php

2. Update your code

Add swagger-php attributes (or legacy annotations) to your source code.

⚠️ The doctrine/annotations library used to parse annotation is going to be deprecated, so wherever possible attributes should be used.

<<< @/snippets/minimal_api_at.php

<<< @/snippets/minimal_api_an.php

3. Generate OpenAPI documentation

> ./vendor/bin/openapi src -o openapi.yaml

4. Explore and interact with your API

Use an OpenAPI tool like Swagger UI or Scalar to explore and interact with your API.

Links

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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport