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

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

binjuhor/lumen-cors
===================

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

v1.0(6y ago)388MITPHPPHP ^7.1

Since Aug 22Pushed 4y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (1)Versions (2)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/).

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/binjuhor/lumen-cors)

[](#install-with-composer)

Run `composer require binjuhor/lumen-cors` to install lumen-cors.

Usage
-----

[](#usage)

### Global CORS

[](#global-cors)

If you want CORS enabled for every HTTP request to your application, head over to your `bootstrap/app.php` file and register your new middleware with the following lines:

```
$app->middleware([
    Binjuhor\Lumen\Middleware\CorsMiddleware::class
 ]);
```

### 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' => 'Binjuhor\Lumen\Middleware\LumenCors',
]);
```

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

```
$app->get('/api/products', ['middleware' => 'cors', function() {
    //Get all products with this route
}]);
```

More info. - [Lumen Registering Middleware](http://lumen.laravel.com/docs/middleware#registering-middleware)

License
-------

[](#license)

[MIT](LICENSE)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

Unknown

Total

1

Last Release

2453d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/556688af8b8c2da5c6e104c4f1c9c17227c4c21028f103c6b3523c302e0cd3b7?d=identicon)[binjuhor](/maintainers/binjuhor)

---

Top Contributors

[![binjuhor](https://avatars.githubusercontent.com/u/4584599?v=4)](https://github.com/binjuhor "binjuhor (6 commits)")

---

Tags

laravelcorslumencross-origincorslumenlumencors

### Embed Badge

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

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

###  Alternatives

[palanik/lumen-cors

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

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

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

4996.4k2](/packages/neomerx-cors-illuminate)[palanik/corsslim

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

94375.3k3](/packages/palanik-corsslim)[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)
