PHPackages                             kubotak-is/l5-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. kubotak-is/l5-swagger

ActiveLibrary[API Development](/categories/api)

kubotak-is/l5-swagger
=====================

Swagger integration to Laravel 5

5.5.2.1(8y ago)016MITPHPPHP ^7.0

Since Mar 23Pushed 8y ago1 watchersCompare

[ Source](https://github.com/kubotak-is/L5-Swagger)[ Packagist](https://packagist.org/packages/kubotak-is/l5-swagger)[ RSS](/packages/kubotak-is-l5-swagger/feed)WikiDiscussions master Synced 2mo ago

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

[![Total Downloads](https://camo.githubusercontent.com/926092d8dc14b9e5982b32eda06b46b117585e1f6f62238c6e1345d591cd3180/68747470733a2f2f706f7365722e707567782e6f72672f4461726b614f6e4c696e652f4c352d537761676765722f646f776e6c6f6164732e737667)](https://packagist.org/packages/DarkaOnLine/L5-Swagger)[![Build Status](https://camo.githubusercontent.com/825f70738d2930ac87468ce7b993b95b9e48d2fb924b76a5bf5495a2f4d42b9c/68747470733a2f2f7472617669732d63692e6f72672f4461726b614f6e4c696e652f4c352d537761676765722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/DarkaOnLine/L5-Swagger)[![Coverage Status](https://camo.githubusercontent.com/ed45802f411b41bd90991501de36a2b310c59f08f2b1d2ebcafaa6fa4d44ef2e/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4461726b614f6e4c696e652f4c352d537761676765722f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/DarkaOnLine/L5-Swagger?branch=master)[![Code Climate](https://camo.githubusercontent.com/ea5a6c02db371c58cfec65aaba48c9bbc36b6ff8c7af3eafc18ef7af1ec5ce62/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f4461726b614f6e4c696e652f4c352d537761676765722f6261646765732f6770612e737667)](https://codeclimate.com/github/DarkaOnLine/L5-Swagger)[![StyleCI](https://camo.githubusercontent.com/b499d07049ce0030ac0175b4f6526c268d571ceaea707e360402358cbfb921d4/68747470733a2f2f7374796c6563692e696f2f7265706f732f33323331353631392f736869656c64)](https://styleci.io/repos/32315619)

L5 Swagger
==========

[](#l5-swagger)

Swagger 2.0 for Laravel &gt;=5.1

This package is a wrapper of [Swagger-php](https://github.com/zircote/swagger-php) and [swagger-ui](https://github.com/swagger-api/swagger-ui) adapted to work with Laravel 5.

Installation
============

[](#installation)

For Swagger 2.0

LaravelSwagger UIOpenAPI Spec compatibilityL5-Swagger5.1.x2.21.1, 1.2, 2.0`php composer require "darkaonline/l5-swagger:~3.0" `5.2.x2.21.1, 1.2, 2.0`php composer require "darkaonline/l5-swagger:~3.0" `5.3.x2.21.1, 1.2, 2.0`php composer require "darkaonline/l5-swagger:~3.0" `5.4.x2.21.1, 1.2, 2.0`php composer require "darkaonline/l5-swagger:~4.0" `5.4.x32.0`php composer require "darkaonline/l5-swagger:5.4.*" `5.5.x32.0`php composer require "darkaonline/l5-swagger:5.5.*" `For Swagger 1.0

```
composer require darkaonline/l5-swagger
```

Open your `AppServiceProvider` (located in `app/Providers`) and add this line in `register` function

```
$this->app->register(\L5Swagger\L5SwaggerServiceProvider::class);
```

or open your `config/app.php` and add this line in `providers` section

```
L5Swagger\L5SwaggerServiceProvider::class,
```

For Laravel 5.5, no need to manually add `L5SwaggerServiceProvider` into config. It uses package auto discovery feature.

Changes in 5.0
==============

[](#changes-in-50)

- Swagger UI 3.
- Configuration changes.
- Assets dependency dropped. Now includes from composer package.
- [See migration](#migrate-from-3040-to-50)

Changes in 4.0
==============

[](#changes-in-40)

- Laravel 5.4 support

Changes in 3.2.1
================

[](#changes-in-321)

- Middleware support for routes (#43) (@tantam)

Changes in 3.2
==============

[](#changes-in-32)

- Allow to change swagger base path in generation process
- Allow to define constants in config which can be used later in annotations
- Tests fix form L5.3 and PHP &gt;= 5.6
- Update swagger UI to 2.1.5

Changes in 3.1
==============

[](#changes-in-31)

- Closure routes moved to controller and got names (thanks to @bbs-smuller [\#19](https://github.com/DarkaOnLine/L5-Swagger/pull/19))
- Added option to rename generated API .json file name

Changes in 3.0
==============

[](#changes-in-30)

- More accurate naming and structured config
- Swagger UI - v2.1.4
- Tests

Migrate from 2.0 to 3.0
=======================

[](#migrate-from-20-to-30)

- Replace `$this->app->register('\Darkaonline\L5Swagger\L5SwaggerServiceProvider');` with `$this->app->register(\L5Swagger\L5SwaggerServiceProvider::class);` in your `AppServiceProvider`or add `\L5Swagger\L5SwaggerServiceProvider::class` line in your `config/app.php` file
- Run `l5-swagger:publish-config` to publish new config and make your changes if needed
- Remove `public/vendor/l5-swagger` directory
- Remove `resources/views/vendor/l5-swagger` directory
- Run `l5-swagger:publish-assets` to publish new swagger-ui assets
- Run `l5-swagger:publish-views` to publish new views

Migrate from 3.0|4.0 to 5.0
===========================

[](#migrate-from-3040-to-50)

- Remove `config/l5-swagger.php` file (make a copy if needed)
- Remove `public/vendor/l5-swagger` directory
- Remove `resources/views/vendor/l5-swagger` directory
- Run `l5-swagger:publish` to publish new swagger-ui view and configuration
- Edit your `config/l5-swagger.php` file

Configuration
=============

[](#configuration)

- Run `l5-swagger:publish` to publish everything
- Run `l5-swagger:publish-config` to publish configs (`config/l5-swagger.php`)
- Run `l5-swagger:publish-assets` to publish swagger-ui to your public folder (`public/vendor/l5-swagger`)
- Run `l5-swagger:publish-views` to publish views (`resources/views/vendor/l5-swagger`) - only for versions &lt;= 4.0
- Run `l5-swagger:generate` to generate docs or set `generate_always` param to `true` in your config or .env file

Swagger-php
===========

[](#swagger-php)

The actual Swagger spec is beyond the scope of this package. All L5-Swagger does is package up swagger-php and swagger-ui in a Laravel-friendly fashion, and tries to make it easy to serve. For info on how to use swagger-php [look here](http://zircote.com/swagger-php/). For good examples of swagger-php in action [look here](https://github.com/zircote/swagger-php/tree/master/Examples/petstore.swagger.io).

Support on Beerpay
------------------

[](#support-on-beerpay)

Hey dude! Help me out for a couple of 🍻!

[![Beerpay](https://camo.githubusercontent.com/05a943f347e2ae7cce58e2ab4a63b30f8d87da0c0371052ec4aa4b4db082e9a3/68747470733a2f2f626565727061792e696f2f4461726b614f6e4c696e652f4c352d537761676765722f62616467652e7376673f7374796c653d626565722d737175617265)](https://beerpay.io/DarkaOnLine/L5-Swagger) [![Beerpay](https://camo.githubusercontent.com/c0b3871e4a1b5c82e24dd3ee98e88b9cd6e3075a915bd524caede9c3391e9488/68747470733a2f2f626565727061792e696f2f4461726b614f6e4c696e652f4c352d537761676765722f6d616b652d776973682e7376673f7374796c653d666c61742d737175617265)](https://beerpay.io/DarkaOnLine/L5-Swagger?focus=wish)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 85.2% 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 ~27 days

Recently: every ~18 days

Total

36

Last Release

3104d ago

Major Versions

v0.2 → v2.02015-05-05

1.0.x-dev → 2.12015-08-04

2.0.x-dev → 3.02016-02-23

3.2.1 → 4.0.x-dev2017-01-30

3.2.3 → 5.02017-06-05

PHP version history (4 changes)v0.1PHP &gt;=5.4.0

3.0PHP &gt;=5.5.9

4.0.x-devPHP &gt;=5.6.4

5.0PHP ^7.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13742370?v=4)[KenjiroKubota](/maintainers/kubotak-is)[@kubotak-is](https://github.com/kubotak-is)

---

Top Contributors

[![DarkaOnLine](https://avatars.githubusercontent.com/u/1171698?v=4)](https://github.com/DarkaOnLine "DarkaOnLine (109 commits)")[![verwilst](https://avatars.githubusercontent.com/u/2114993?v=4)](https://github.com/verwilst "verwilst (4 commits)")[![jpuck](https://avatars.githubusercontent.com/u/15305396?v=4)](https://github.com/jpuck "jpuck (2 commits)")[![fh-jashmore](https://avatars.githubusercontent.com/u/26600475?v=4)](https://github.com/fh-jashmore "fh-jashmore (2 commits)")[![bbs-smuller](https://avatars.githubusercontent.com/u/18079210?v=4)](https://github.com/bbs-smuller "bbs-smuller (2 commits)")[![joshstrange](https://avatars.githubusercontent.com/u/462796?v=4)](https://github.com/joshstrange "joshstrange (1 commits)")[![josiasmontag](https://avatars.githubusercontent.com/u/1945577?v=4)](https://github.com/josiasmontag "josiasmontag (1 commits)")[![cyberhicham](https://avatars.githubusercontent.com/u/10002527?v=4)](https://github.com/cyberhicham "cyberhicham (1 commits)")[![markokeeffe](https://avatars.githubusercontent.com/u/1211393?v=4)](https://github.com/markokeeffe "markokeeffe (1 commits)")[![matriphe](https://avatars.githubusercontent.com/u/277262?v=4)](https://github.com/matriphe "matriphe (1 commits)")[![stefanullrich](https://avatars.githubusercontent.com/u/3226657?v=4)](https://github.com/stefanullrich "stefanullrich (1 commits)")[![tantam](https://avatars.githubusercontent.com/u/3469994?v=4)](https://github.com/tantam "tantam (1 commits)")[![tomcastleman](https://avatars.githubusercontent.com/u/1532660?v=4)](https://github.com/tomcastleman "tomcastleman (1 commits)")[![gert-fresh](https://avatars.githubusercontent.com/u/1530784?v=4)](https://github.com/gert-fresh "gert-fresh (1 commits)")

---

Tags

apilaravelswagger

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/kubotak-is-l5-swagger/health.svg)

```
[![Health](https://phpackages.com/badges/kubotak-is-l5-swagger/health.svg)](https://phpackages.com/packages/kubotak-is-l5-swagger)
```

###  Alternatives

[darkaonline/l5-swagger

OpenApi or Swagger integration to Laravel

2.9k34.0M112](/packages/darkaonline-l5-swagger)[darkaonline/swagger-lume

OpenApi or Swagger integration to Lumen

3372.3M3](/packages/darkaonline-swagger-lume)

PHPackages © 2026

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