PHPackages                             palanik/lumen-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. [HTTP &amp; Networking](/categories/http)
4. /
5. palanik/lumen-cors

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

palanik/lumen-cors
==================

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

v0.0.3(8y ago)101237.4k↓28%30[6 issues](https://github.com/palanik/lumen-cors/issues)[2 PRs](https://github.com/palanik/lumen-cors/pulls)MITPHP

Since Apr 20Pushed 8y ago5 watchersCompare

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

READMEChangelogDependenciesVersions (4)Used By (0)

Lumen-CORS
==========

[](#lumen-cors)

[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/).

[![Latest Stable Version](https://camo.githubusercontent.com/1cc3c3ad3bedb3a726449ee99a7883c16a67791a283bf48d0e7ad53d614c8549/68747470733a2f2f706f7365722e707567782e6f72672f70616c616e696b2f6c756d656e2d636f72732f762f737461626c652e737667)](https://packagist.org/packages/palanik/lumen-cors)[![License](https://camo.githubusercontent.com/1efaefdf73df6e013097ba39d4f98dd640f523371965b007768c2c0e8485bb3d/68747470733a2f2f706f7365722e707567782e6f72672f70616c616e696b2f6c756d656e2d636f72732f6c6963656e73652e737667)](https://github.com/palanik/lumen-cors/blob/master/LICENSE)

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

[](#installation)

After you install lumen as per [lumen docs](http://lumen.laravel.com/docs/installation#install-lumen), install lumen-cors from `lumen` folder.

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

[](#install-with-composer)

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

### Manual Installation

[](#manual-installation)

Copy the file LumenCors.php into `app/Http/Middleware` directory.

Usage
-----

[](#usage)

### Global CORS

[](#global-cors)

If you want CORS enabled for every HTTP request to your application, simply list the middleware class `palanik\lumen\Middleware\LumenCors` 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 `lumen-cors` middleware a short-hand key in your `bootstrap/app.php` file.

```
$app->routeMiddleware([
    'cors' => 'palanik\lumen\Middleware\LumenCors',
]);
```

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

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

More info. -

License
-------

[](#license)

[MIT](LICENSE)

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity49

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 82.4% 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 ~398 days

Total

3

Last Release

3251d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1656913?v=4)[Palani Kumanan](/maintainers/palanik)[@palanik](https://github.com/palanik)

---

Top Contributors

[![palanik](https://avatars.githubusercontent.com/u/1656913?v=4)](https://github.com/palanik "palanik (14 commits)")[![jeremyhuvt](https://avatars.githubusercontent.com/u/19679830?v=4)](https://github.com/jeremyhuvt "jeremyhuvt (2 commits)")[![robycup](https://avatars.githubusercontent.com/u/2480140?v=4)](https://github.com/robycup "robycup (1 commits)")

---

Tags

laravelcorslumencross-originpreflightcorslumenlumencors

### Embed Badge

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

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

###  Alternatives

[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)[middlewares/cors

Middleware to implement Cross-Origin Resource Sharing (CORS)

1372.2k3](/packages/middlewares-cors)

PHPackages © 2026

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