PHPackages                             kayne/swagger - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. kayne/swagger

ActiveLibrary[HTTP &amp; Networking](/categories/http)

kayne/swagger
=============

A minimal Swagger/OpenAPI documentation generator for Laravel using DTOs. 80% less code than l5-swagger with type-safe validation.

v2.2.2(3mo ago)341MITPHPPHP ^8.1CI failing

Since Dec 27Pushed 3mo agoCompare

[ Source](https://github.com/Kayne1310/KayneSwagger)[ Packagist](https://packagist.org/packages/kayne/swagger)[ Docs](https://github.com/YOUR_USERNAME/swagger)[ RSS](/packages/kayne-swagger/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (7)Versions (25)Used By (0)

Kayne-Swagger
=============

[](#kayne-swagger)

A minimal, clean Swagger/OpenAPI documentation generator for Laravel using strongly-typed DTOs.

Features
--------

[](#features)

- **Type-Safe DTOs**: Use PHP 8.1+ type hints instead of doc comments
- **FormRequestDto Support**: Seamlessly integrate existing FormRequest with Swagger
- **Minimal Code**: 80% less boilerplate than l5-swagger
- **Auto-Validation**: Automatic validation from type definitions
- **Auto Security Detection**: Automatically detect JWT/Bearer token from route middleware
- **Form Body Support**: Support form-data and x-www-form-urlencoded like .NET
- **Query Parameters**: Auto-convert FormRequestDto to query params in GET requests
- **Nested Arrays**: Full support for nested arrays and array items
- **Clean Syntax**: Modern PHP attributes instead of verbose annotations
- **DRY Principle**: Define once, use everywhere
- **Like .NET Swagger**: Fast and efficient like .NET Core

Installation
------------

[](#installation)

```
composer require kayne/swagger
```

The package will auto-register via Laravel's package discovery.

See [INSTALLATION.md](INSTALLATION.md) for detailed installation guide.

Quick Start
-----------

[](#quick-start)

### 1. Create a DTO (Optional annotations!)

[](#1-create-a-dto-optional-annotations)

```
