PHPackages                             maxim-sarandev/lumen-swagger-cors - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. maxim-sarandev/lumen-swagger-cors

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

maxim-sarandev/lumen-swagger-cors
=================================

CORS configuration added to the base Swagger Lumen repo

01.1kPHP

Since May 30Pushed 6y ago1 watchersCompare

[ Source](https://github.com/MSarandev/LumenSwaggerCors)[ Packagist](https://packagist.org/packages/maxim-sarandev/lumen-swagger-cors)[ RSS](/packages/maxim-sarandev-lumen-swagger-cors/feed)WikiDiscussions develop Synced yesterday

READMEChangelogDependenciesVersions (2)Used By (0)

Customised "SwaggerLume"
========================

[](#customised-swaggerlume)

Info
====

[](#info)

This package has been cloned for the purposes of defining a set of CORS headers, that will be included in the default response object.

No other logic has been currently edited.

All credit is due to the creator of the original "SwaggerLume" codebase - `thank you`!

Swagger 2.0 for Lumen 5
=======================

[](#swagger-20-for-lumen-5)

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 Lumen 5.

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

[](#installation)

LumenSwagger UIOpenAPI Spec compatibilityL5-Swagger5.0 - 5.32.21.1, 1.2, 2.0`composer require "darkaonline/swagger-lume:~1.0"`5.4.x2.21.1, 1.2, 2.0`composer require "darkaonline/swagger-lume:~2.0"`5.4.x32.0`composer require "darkaonline/swagger-lume:~3.0"`5.5.x32.0`composer require "darkaonline/swagger-lume:5.5.*"`5.6 - 5.732.0, 3.0`composer require "darkaonline/swagger-lume:5.6.*"`- Open your `bootstrap/app.php` file and:

uncomment this line (around line 26) in `Create The Application` section:

```
     $app->withFacades();
```

add this line before `Register Container Bindings` section:

```
     $app->configure('swagger-lume');
```

add this line in `Register Service Providers` section:

```
    $app->register(\SwaggerLume\ServiceProvider::class);
```

- Run `php artisan swagger-lume:publish-config` to publish configs (`config/swagger-lume.php`)
- Make configuration changes if needed
- Run `php artisan swagger-lume:publish` to publish everything

Using [OpenApi 3.0 Specification](https://github.com/OAI/OpenAPI-Specification)
===============================================================================

[](#using-openapi-30-specification)

If you would like to use lattes OpenApi specifications (originally known as the Swagger Specification) in you project you should:

- Explicitly require `swagger-php` version 3.\* in your projects composer by running:

```
composer require 'zircote/swagger-php:3.*'
```

- Set environment variable `SWAGGER_VERSION` to **3.0** in your `.env` file:

```
SWAGGER_VERSION=3.0

```

or in your `config/l5-swagger.php`:

```
'swagger_version' => env('SWAGGER_VERSION', '3.0'),
```

- Use examples provided here:

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

[](#configuration)

- Run `php artisan swagger-lume:publish-config` to publish configs (`config/swagger-lume.php`)
- Run `php artisan swagger-lume:publish-views` to publish views (`resources/views/vendor/swagger-lume`)
- Run `php artisan swagger-lume:publish` to publish everything
- Run `php artisan swagger-lume:generate` to generate docs

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

[](#changes-in-30)

- Swagger UI 3.
- Configuration changes.
- Assets dependency dropped. Now includes from composer package.
- [See migration from 2.0 to 3.0](#migrate-from-20-to-30-or-55)

Changes in 2.0
==============

[](#changes-in-20)

- Lumen 5.4 support
- Swagger UI 2.2.8

Migrate from 2.0 to 3.0 or 5.5
==============================

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

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

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

[](#swagger-php)

The actual Swagger spec is beyond the scope of this package. All SwaggerLume 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).

\#The link below supports DarkaOnLine

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

[](#support-on-beerpay)

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

[![Beerpay](https://camo.githubusercontent.com/09595e28af18b413c5ac95353470513289b045b8b1f1a03a53470d0abc13ba17/68747470733a2f2f626565727061792e696f2f4461726b614f6e4c696e652f537761676765724c756d652f62616467652e7376673f7374796c653d626565722d737175617265)](https://beerpay.io/DarkaOnLine/SwaggerLume) [![Beerpay](https://camo.githubusercontent.com/6a1ea317bd6c428beba4fa37f0baae0570952218f5e3db8d35328ed5424269cc/68747470733a2f2f626565727061792e696f2f4461726b614f6e4c696e652f537761676765724c756d652f6d616b652d776973682e7376673f7374796c653d666c61742d737175617265)](https://beerpay.io/DarkaOnLine/SwaggerLume?focus=wish)

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 80.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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/dd2ca82f80ff99e7c83376d94d04efb55a31554d6070618f484bc1de2dbb3a5f?d=identicon)[MSarandev](/maintainers/MSarandev)

---

Top Contributors

[![DarkaOnLine](https://avatars.githubusercontent.com/u/1171698?v=4)](https://github.com/DarkaOnLine "DarkaOnLine (73 commits)")[![Tk-ms](https://avatars.githubusercontent.com/u/62694333?v=4)](https://github.com/Tk-ms "Tk-ms (7 commits)")[![jvleeuwen](https://avatars.githubusercontent.com/u/21260099?v=4)](https://github.com/jvleeuwen "jvleeuwen (4 commits)")[![nathanejohnson](https://avatars.githubusercontent.com/u/1360240?v=4)](https://github.com/nathanejohnson "nathanejohnson (2 commits)")[![stcktrce](https://avatars.githubusercontent.com/u/40738917?v=4)](https://github.com/stcktrce "stcktrce (1 commits)")[![LiamBull](https://avatars.githubusercontent.com/u/17298523?v=4)](https://github.com/LiamBull "LiamBull (1 commits)")[![jellebreuer](https://avatars.githubusercontent.com/u/5371337?v=4)](https://github.com/jellebreuer "jellebreuer (1 commits)")[![cocochepeau](https://avatars.githubusercontent.com/u/2019778?v=4)](https://github.com/cocochepeau "cocochepeau (1 commits)")[![mglinski](https://avatars.githubusercontent.com/u/78872?v=4)](https://github.com/mglinski "mglinski (1 commits)")

### Embed Badge

![Health badge](/badges/maxim-sarandev-lumen-swagger-cors/health.svg)

```
[![Health](https://phpackages.com/badges/maxim-sarandev-lumen-swagger-cors/health.svg)](https://phpackages.com/packages/maxim-sarandev-lumen-swagger-cors)
```

###  Alternatives

[zzstudio/think-addons

The ThinkPHP6 Addons Package

1518.6k](/packages/zzstudio-think-addons)[medialounge/magento2-storyblok-integration

Magento 2 extension to integrate Storyblok visual editor

2965.1k](/packages/medialounge-magento2-storyblok-integration)

PHPackages © 2026

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