PHPackages                             freedomcore/laravel-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. [API Development](/categories/api)
4. /
5. freedomcore/laravel-swagger

ActiveLibrary[API Development](/categories/api)

freedomcore/laravel-swagger
===========================

Swagger documentation generator for Laravel

1.0.1(5y ago)33392MITPHP

Since Oct 24Pushed 5y ago2 watchersCompare

[ Source](https://github.com/darki73/laravel-swagger)[ Packagist](https://packagist.org/packages/freedomcore/laravel-swagger)[ RSS](/packages/freedomcore-laravel-swagger/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (4)Versions (3)Used By (0)

Laravel Swagger
===============

[](#laravel-swagger)

Simple to use OAS3 compatible documentation generator.
Also includes Swagger UI.
[![Total Downloads](https://camo.githubusercontent.com/e46193c4e06914ba19a4fe38b89456272b1fd4eca7738bb307365d4a1354d829/68747470733a2f2f706f7365722e707567782e6f72672f66726565646f6d636f72652f6c61726176656c2d737761676765722f646f776e6c6f6164732e737667)](https://packagist.org/packages/freedomcore/laravel-swagger)[![GuitHub Sponsor](https://camo.githubusercontent.com/68a13a6050818a6fc6821e4d850ab85543bb940b94bee4698a0659fb7a7c3e41/68747470733a2f2f696d672e736869656c64732e696f2f7374617469632f76313f6c6162656c3d53706f6e736f7225323066726565646f6d636f72652f6c61726176656c2d73776167676572266d6573736167653d254532253944254134266c6f676f3d476974487562266c696e6b3d68747470733a2f2f6769746875622e636f6d2f73706f6e736f72732f6461726b693733)](https://img.shields.io/static/v1?label=Sponsor%20freedomcore/laravel-swagger&message=%E2%9D%A4&logo=GitHub&link=https://github.com/sponsors/darki73)

About
-----

[](#about)

This package is heavily inspired by the [mtrajano/laravel-swagger](https://github.com/mtrajano/laravel-swagger) and [DarkaOnLine/L5-Swagger](https://github.com/DarkaOnLine/L5-Swagger).
Usage is pretty similar to the `mtrajano/laravel-swagger` with the difference being:

1. OAS3 support
2. "Custom decorators" inspired by Nest.JS
3. Automatic generation (assuming relevant configuration option is turned on)
4. Inclusion of Swagger UI

I've spent a couple of hours making this package to suit my needs, and it does so far.
All I am trying to say is - **I don't think I will be actively maintaining this package unless people will have interest in it**.

Requirements
------------

[](#requirements)

This package developed on `Laravel 8.11.2`, but it might work on the previous releases.
All other requirements are inherited from the `Laravel 8`.

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

[](#installation)

#### Install package through composer

[](#install-package-through-composer)

```
composer require freedomcore/laravel-swagger
```

#### Publish configuration files and views

[](#publish-configuration-files-and-views)

```
php artisan vendor:publish --provider "FreedomCore\Swagger\SwaggerServiceProvider"
```

#### Edit the `swagger.php` configuration file for your liking

[](#edit-the-swaggerphp-configuration-file-for-your-liking)

Usage
-----

[](#usage)

### @Request() decorator

[](#request-decorator)

You can have only one `@Request()` decorator.

```
/**
* You can also do this, first line will be "summary"
*
* And anything 1 * apart from the "summary" will count as "description"
*
* @Request({
*     summary: Title of the route,
*     description: This is a longer description for the route which will be visible once the panel is expanded,
*     tags: Authentication,Users
* })
*/
public function someMethod(Request $request) {}
```

### @Response() decorator

[](#response-decorator)

You can have multiple `@Response` decorators

```
/**
* @Response({
*     code: 302
*     description: Redirect
* })
* @Response({
*     code: 400
*     description: Bad Request
* })
* @Response({
*     code: 500
*     description: Internal Server Error
* })
*/
public function someMethod(Request $request) {}
```

### Custom Validators

[](#custom-validators)

These validators are made purely for visual purposes, however, some of them can actually do validation

#### swagger\_default

[](#swagger_default)

```
$rules = [
    'locale'        =>  'swagger_default:en_GB'
];
```

#### swagger\_min

[](#swagger_min)

```
$rules = [
    'page'          =>  'swagger_default:1|swagger_min:1', // This will simply display the 'minimum' value in the documentation
    'page'          =>  'swagger_default:1|swagger_min:1:fail' // This will also fail if the `page` parameter will be less than 1
];
```

#### swagger\_max

[](#swagger_max)

```
$rules = [
    'take'          =>  'swagger_default:1|swagger_min:1|swagger_max:50', // This will simply display the 'maximum' value in the documentation
    'take'          =>  'swagger_default:1|swagger_min:1|swagger_max:50:fail' // This will also fail if the `take` parameter will be greater than 50
];
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

2

Last Release

2023d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/59848fdf0747788942e0c30e483a8eccb4698e0c34db490db565b6a18992442d?d=identicon)[darki73](/maintainers/darki73)

---

Top Contributors

[![darki73](https://avatars.githubusercontent.com/u/1318627?v=4)](https://github.com/darki73 "darki73 (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/freedomcore-laravel-swagger/health.svg)

```
[![Health](https://phpackages.com/badges/freedomcore-laravel-swagger/health.svg)](https://phpackages.com/packages/freedomcore-laravel-swagger)
```

###  Alternatives

[phpdocumentor/phpdocumentor

Documentation Generator for PHP

4.4k3.1M876](/packages/phpdocumentor-phpdocumentor)[googleads/googleads-php-lib

Google Ad Manager SOAP API Client Library for PHP

67410.3M25](/packages/googleads-googleads-php-lib)[thecodingmachine/graphqlite

Write your GraphQL queries in simple to write controllers (using webonyx/graphql-php).

5723.1M30](/packages/thecodingmachine-graphqlite)[felixfbecker/advanced-json-rpc

A more advanced JSONRPC implementation

25578.7M6](/packages/felixfbecker-advanced-json-rpc)[overblog/graphql-bundle

This bundle provides tools to build a GraphQL server in your Symfony App.

8027.9M28](/packages/overblog-graphql-bundle)[api-platform/api-pack

A pack for API Platform

5236.7M40](/packages/api-platform-api-pack)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
