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

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

nordsoftware/lumen-cors
=======================

CORS module for the Lumen PHP framework.

3.5.0(4y ago)94508.4k—2.2%341MITPHPPHP &gt;=7.1

Since May 14Pushed 3y ago13 watchersCompare

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

READMEChangelog (2)Dependencies (10)Versions (35)Used By (1)

Lumen CORS
==========

[](#lumen-cors)

[![GitHub Actions status](https://github.com/digiaonline/lumen-cors/workflows/Test/badge.svg)](https://github.com/digiaonline/lumen-cors/actions)[![Coverage Status](https://camo.githubusercontent.com/ba48efc2cdfc4a8d900dce6c899e8ef1752a9b567fd5d8ce263ef3a421fe9353/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f64696769616f6e6c696e652f6c756d656e2d636f72732f62616467652e7376673f6272616e63683d6d61696e)](https://coveralls.io/github/digiaonline/lumen-cors?branch=main)[![Code Climate](https://camo.githubusercontent.com/ffa034f6496296152271e4bc1d69acc52cef614e475000cea0ffe77a89d7a3bd/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6e6f7264736f6674776172652f6c756d656e2d636f72732f6261646765732f6770612e737667)](https://codeclimate.com/github/nordsoftware/lumen-cors)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/836151b44815de63fce4ceae2c7c08dea516480f5884da680d61b68efa957f1a/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f64696769616f6e6c696e652f6c756d656e2d636f72732f6261646765732f7175616c6974792d73636f72652e706e673f623d6d61696e)](https://scrutinizer-ci.com/g/digiaonline/lumen-cors/?branch=main)[![StyleCI](https://camo.githubusercontent.com/5f8b9eb5a73995406eda3699c9ad096617264bc7860e0d34c8b35dcd63bc6efc/68747470733a2f2f7374796c6563692e696f2f7265706f732f33353537313236332f736869656c643f7374796c653d666c6174)](https://styleci.io/repos/35571263)[![Latest Stable Version](https://camo.githubusercontent.com/68e02ee150115c179ef9d5d6984999dff751a2802f11531d2bda54848c938dce/68747470733a2f2f706f7365722e707567782e6f72672f6e6f7264736f6674776172652f6c756d656e2d636f72732f76657273696f6e)](https://packagist.org/packages/nordsoftware/lumen-cors)[![Total Downloads](https://camo.githubusercontent.com/6a28960c9fa565a1fa990648f85e0e93d9b0a2e968ff23136f7e200b627edcb5/68747470733a2f2f706f7365722e707567782e6f72672f6e6f7264736f6674776172652f6c756d656e2d636f72732f646f776e6c6f616473)](https://packagist.org/packages/nordsoftware/lumen-cors)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

[Cross-Origin Resource Sharing](http://enable-cors.org/) (CORS) module for the [Lumen PHP framework](http://lumen.laravel.com/).

Requirements
------------

[](#requirements)

- PHP 7.1 or newer
- [Composer](http://getcomposer.org)
- [Lumen](https://lumen.laravel.com/) 5.4 or newer

Usage
-----

[](#usage)

### Installation

[](#installation)

Run the following command to install the package through Composer:

```
composer require nordsoftware/lumen-cors
```

### Configure

[](#configure)

Copy the configuration template in `config/cors.php` to your application's `config` directory and modify according to your needs. For more information see the [Configuration Files](http://lumen.laravel.com/docs/configuration#configuration-files) section in the Lumen documentation.

Available configuration options:

- **allow\_origins** `array` *Origins that are allowed to perform requests, defaults to an empty array. Patterns also accepted, for example \*.foo.com*
- **allow\_methods** `array` *HTTP methods that are allowed, defaults to an empty array*
- **allow\_headers** `array` *HTTP headers that are allowed, defaults to an empty array*
- **allow\_credentials** `boolean` *Whether or not the response can be exposed when credentials are present, defaults to false*
- **expose\_headers** `array` *HTTP headers that are allowed to be exposed to the web browser, defaults to an empty array*
- **max\_age** `integer` *Indicates how long preflight request can be cached, defaults to 0*

### Bootstrapping

[](#bootstrapping)

Add the following lines to `bootstrap/app.php`:

```
$app->register('Nord\Lumen\Cors\CorsServiceProvider');
```

```
$app->middleware([
	.....
	'Nord\Lumen\Cors\CorsMiddleware',
]);
```

The module now automatically handles all CORS requests.

Customizing behavior
--------------------

[](#customizing-behavior)

While the service can be configured somewhat using `config/cors.php`, some more exotic things such as regular expressions for allowed origins cannot. If you need to, you can provide this custom functionality yourself:

1. Extend `CorsService` and override e.g. `isOriginAllowed()`
2. Extend `CorsServiceProvider` and override `registerBindings()`, then register your own service class instead

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

[](#contributing)

Please read the [guidelines](.github/CONTRIBUTING.md).

Running tests
-------------

[](#running-tests)

Clone the project and install its dependencies by running:

```
composer install
```

Run the following command to run the test suite:

```
composer test
```

License
-------

[](#license)

See [LICENSE](LICENSE).

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity52

Moderate usage in the ecosystem

Community31

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~76 days

Recently: every ~293 days

Total

34

Last Release

1516d ago

Major Versions

1.x-dev → 2.0.02017-02-20

2.x-dev → 3.0.02018-10-15

PHP version history (3 changes)1.0.0PHP &gt;=5.4

1.7.0PHP &gt;=5.6

3.0.0PHP &gt;=7.1

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/2f766f3d06300e4e58806cac328ec6774408e2782497f3624f6112e0838bd057?d=identicon)[soderluk](/maintainers/soderluk)

![](https://www.gravatar.com/avatar/0946a262e18034427b1a75b8f2b9edc25395f33e5f514c616de79c69312e2b92?d=identicon)[kryysler](/maintainers/kryysler)

![](https://www.gravatar.com/avatar/71b6ac8e861b06d0c801083af34bbdc5082de87488d08e965762a8a771c23997?d=identicon)[woss](/maintainers/woss)

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

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

![](https://www.gravatar.com/avatar/6e20e7bc5947632a9aa1e5a718a8518136f7341edff04e4d6110fc2f9da70ce0?d=identicon)[laxu](/maintainers/laxu)

---

Top Contributors

[![cniska](https://avatars.githubusercontent.com/u/1044868?v=4)](https://github.com/cniska "cniska (71 commits)")[![hugovk](https://avatars.githubusercontent.com/u/1324225?v=4)](https://github.com/hugovk "hugovk (50 commits)")[![Jalle19](https://avatars.githubusercontent.com/u/1106133?v=4)](https://github.com/Jalle19 "Jalle19 (25 commits)")[![ngabor84](https://avatars.githubusercontent.com/u/22472700?v=4)](https://github.com/ngabor84 "ngabor84 (11 commits)")[![soderluk](https://avatars.githubusercontent.com/u/6086071?v=4)](https://github.com/soderluk "soderluk (11 commits)")[![gusdemayo](https://avatars.githubusercontent.com/u/72032719?v=4)](https://github.com/gusdemayo "gusdemayo (2 commits)")[![kryysler](https://avatars.githubusercontent.com/u/3352265?v=4)](https://github.com/kryysler "kryysler (2 commits)")[![ibpavlov](https://avatars.githubusercontent.com/u/3340235?v=4)](https://github.com/ibpavlov "ibpavlov (1 commits)")[![christianjul](https://avatars.githubusercontent.com/u/1423227?v=4)](https://github.com/christianjul "christianjul (1 commits)")

---

Tags

corslumenlumen-corslumen-php-frameworknord-softwarehttprequestlaravelcorslumenheadersresourcesharingcross-originpreflight

###  Code Quality

TestsCodeception

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[palanik/lumen-cors

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

101237.4k](/packages/palanik-lumen-cors)[jdesrosiers/silex-cors-provider

A silex service provider that adds CORS services to silex

83892.3k10](/packages/jdesrosiers-silex-cors-provider)[chelout/laravel-http-logger

A Laravel package to log HTTP requests, headers and sessions

272.0k](/packages/chelout-laravel-http-logger)[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)
