PHPackages                             dragonfire1119/cors-lumen - 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. dragonfire1119/cors-lumen

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

dragonfire1119/cors-lumen
=========================

Cross-origin resource sharing (CORS) middleware &amp; ServiceProvider for Lumen micro-framework.

v0.1.0(11y ago)34741MITPHPPHP &gt;=5.4.0

Since Apr 26Pushed 10y ago2 watchersCompare

[ Source](https://github.com/dragonfire1119/cors-lumen)[ Packagist](https://packagist.org/packages/dragonfire1119/cors-lumen)[ Docs](https://github.com/dragonfire1119/cors-lumen)[ RSS](/packages/dragonfire1119-cors-lumen/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (6)Used By (0)

CORS for Lumen
==============

[](#cors-for-lumen)

[![Latest Stable Version](https://camo.githubusercontent.com/b49d9a1ccf6a7041177957848064ce4a7bdbe90890440413a1a9376c42a72938/68747470733a2f2f706f7365722e707567782e6f72672f647261676f6e66697265313131392f636f72732d6c756d656e2f762f737461626c65)](https://packagist.org/packages/dragonfire1119/cors-lumen)[![License](https://camo.githubusercontent.com/dbde206200cff2ea4adb39c9aa833cd10b9d30b88d2f6c353f8791b8259ac7f9/68747470733a2f2f706f7365722e707567782e6f72672f647261676f6e66697265313131392f636f72732d6c756d656e2f6c6963656e7365)](https://packagist.org/packages/dragonfire1119/cors-lumen)

[Cross-origin resource sharing](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS) (CORS) Middleware for [Lumen micro-framework](http://lumen.laravel.com/).

### Install with [Composer](https://packagist.org/packages/dragonfire1119/cors-lumen)

[](#install-with-composer)

Run `composer require "dragonfire1119/cors-lumen:dev-master"` to install cors-lumen.

Usage
-----

[](#usage)

### Add CORS ServiceProvider

[](#add-cors-serviceprovider)

If you want to allow OPTIONS method then your going to need to enable the CorsServiceProvider in the `bootstrap/app.php` file.

```
$app->register('Dragonfire1119\Cors\Providers\CorsServiceProvider');
```

### Global CORS

[](#global-cors)

If you want CORS enabled for every HTTP request to your application, simply list the middleware class `Dragonfire1119\Cors\Middleware\CorsMiddleware` in the $app-&gt;middleware() call of your `bootstrap/app.php` file.

### CORS for Routes

[](#cors-for-routes)

If you would like to enable CORS to specific routes, you should first assign the `cors` middleware a short-hand key in your `bootstrap/app.php` file.

```
$app->routeMiddleware([
	'cors' => 'Dragonfire1119\Cors\Middleware\CorsMiddleware',
]);
```

Then, you use the key in the route options array.

```
$app->get('/api/test', ['middleware' => 'cors', function() {
    //
}]);
```

More info. -

Contributing
------------

[](#contributing)

If you have a change fork it &amp; make a pull request. :)

License
-------

[](#license)

Released under the [MIT](LICENSE), see LICENSE.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

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

5

Last Release

4037d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1289128?v=4)[Christopher ](/maintainers/dragonfire1119)[@dragonfire1119](https://github.com/dragonfire1119)

---

Top Contributors

[![dragonfire1119](https://avatars.githubusercontent.com/u/1289128?v=4)](https://github.com/dragonfire1119 "dragonfire1119 (16 commits)")

---

Tags

laravelcorslumencross-originpreflightcorslumenlumencors

### Embed Badge

![Health badge](/badges/dragonfire1119-cors-lumen/health.svg)

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

###  Alternatives

[palanik/lumen-cors

Cross-origin resource sharing (CORS) middleware for Lumen micro-framework.

101237.4k](/packages/palanik-lumen-cors)[palanik/corsslim

Cross-origin resource sharing (CORS) middleware for PHP Slim.

94375.3k3](/packages/palanik-corsslim)[neomerx/cors-illuminate

CORS (Cross-Origin Resource Sharing) support for Laravel and Lumen

4996.4k2](/packages/neomerx-cors-illuminate)[rap2hpoutre/jacky

Opinionated REST JSON HTTP API client for laravel

174.4k](/packages/rap2hpoutre-jacky)

PHPackages © 2026

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