PHPackages                             domoticalabs/cors-preflight - 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. domoticalabs/cors-preflight

ActiveLibrary

domoticalabs/cors-preflight
===========================

Cors/Preflight request middleware for Lumen/Laravel

1.0.0(7y ago)07MITPHPPHP &gt;=7.0.0

Since Dec 21Pushed 7y ago3 watchersCompare

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

READMEChangelog (1)DependenciesVersions (2)Used By (0)

cors-preflight
==============

[](#cors-preflight)

Lumen/Laravel package that creates a middleware for adding CORS headers to all incoming requests. It also adds *Access-Control-Allow-Methods* header to the OPTIONS requests with all the routes-registered methods. This is useful for [preflight](https://developer.mozilla.org/en-US/docs/Glossary/Preflight_request) requests.

Example:
--------

[](#example)

With this routes:

```
$router->get('/test', function () use ($router) {
    return $router->app->version();
});
$router->post('/test', function () use ($router) {
    return $router->app->version();
});
```

The response headers for OPTIONS request on `/test` route is:

```
Access-Control-Allow-Origin →*
Access-Control-Allow-Credentials →true
Access-Control-Max-Age →86400
Access-Control-Allow-Headers →Content-Type, Authorization, X-Requested-With
Access-Control-Allow-Methods →OPTIONS,GET,POST

```

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

[](#installation)

Install this package using composer: `composer require dusterio/lumen-passport`

### Enable middleware

[](#enable-middleware)

You need to edit your `bootstrap\app.php` file and uncomment this line:

```
$app->withFacades();
```

and add this lines:

```
$app->middleware([
   Domoticalabs\CorsPreflight\CorsPreflightMiddleware::class
]);
```

License
-------

[](#license)

The MIT License (MIT) Copyright (c) 2018 [Domotica Labs](https://www.domoticalabs.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity55

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

2696d ago

### Community

Maintainers

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

---

Top Contributors

[![davideferre](https://avatars.githubusercontent.com/u/10563913?v=4)](https://github.com/davideferre "davideferre (3 commits)")

### Embed Badge

![Health badge](/badges/domoticalabs-cors-preflight/health.svg)

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

PHPackages © 2026

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