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

ActiveLibrary

razor9999/cors-lumen
====================

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

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

Since Apr 26Pushed 10y ago1 watchersCompare

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

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

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

[](#cors-for-lumen)

[![Latest Stable Version](https://camo.githubusercontent.com/96e7122388d26f01de5a1f8409e5fe8718211615cf5c5bcc75371d6eff51cae3/68747470733a2f2f706f7365722e707567782e6f72672f72617a6f72393939392f636f72732d6c756d656e2f762f737461626c65)](https://packagist.org/packages/razor9999/cors-lumen)[![License](https://camo.githubusercontent.com/ced0bd7e25abc469f2ddd856f000cd3c53cf51b9817f6cab5e6722a3d6e5712d/68747470733a2f2f706f7365722e707567782e6f72672f72617a6f72393939392f636f72732d6c756d656e2f6c6963656e7365)](https://packagist.org/packages/razor9999/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/razor9999/cors-lumen)

[](#install-with-composer)

Run `composer require "razor9999/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('razor9999\Cors\Providers\CorsServiceProvider');
```

### Global CORS

[](#global-cors)

If you want CORS enabled for every HTTP request to your application, simply list the middleware class `razor9999\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' => 'razor9999\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

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 72.7% 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

4029d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/25c4fc251cc5896609daa816177134a275282d54576a7f8a63c17f0c0421e20a?d=identicon)[razor9999](/maintainers/razor9999)

---

Top Contributors

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

---

Tags

laravelcorslumencross-originpreflightcorslumenlumencors

### Embed Badge

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

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

###  Alternatives

[palanik/lumen-cors

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

101237.4k](/packages/palanik-lumen-cors)[kitloong/laravel-migrations-generator

Generates Laravel Migrations from an existing database

2.9k7.4M24](/packages/kitloong-laravel-migrations-generator)[mollie/laravel-mollie

Mollie API client wrapper for Laravel &amp; Mollie Connect provider for Laravel Socialite

3624.1M28](/packages/mollie-laravel-mollie)[axlon/laravel-postal-code-validation

Worldwide postal code validation for Laravel and Lumen

3853.3M1](/packages/axlon-laravel-postal-code-validation)[laravel-lang/publisher

Localization publisher for your Laravel application

2167.7M24](/packages/laravel-lang-publisher)[kra8/laravel-snowflake

Snowflake for Laravel and Lumen.

188402.3k6](/packages/kra8-laravel-snowflake)

PHPackages © 2026

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