PHPackages                             phpnexus/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. phpnexus/cors

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

phpnexus/cors
=============

Provides a reusable framework-agnostic CORS class.

0.3.6(3mo ago)45681Apache-2.0PHPPHP ^8.1CI passing

Since May 7Pushed 3mo ago1 watchersCompare

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

READMEChangelog (3)Dependencies (2)Versions (14)Used By (1)

CORS
====

[](#cors)

[![Latest Version](https://camo.githubusercontent.com/722a56613affc6b4a9eb7a85f1232510a4183a83c5a3b3455341f92882fe9244/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7068706e657875732f636f72732e7376673f7374796c653d666c61742d737175617265)](https://github.com/phpnexus/cors/releases)[![Software License](https://camo.githubusercontent.com/effa8235d7eba5e273e8712a2c110b76565138e21b71cdd10ea6082613f07943/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4170616368655f322e302d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

Provides a lightweight, extensible, framework-agnostic CORS class.

**You probably want to check these specific implementations for easy installation**

- [PSR-7](https://github.com/phpnexus/cors-psr7)

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

[](#installation)

It's recommended that you use [Composer](https://getcomposer.org/) to install Cors:

```
$ composer require phpnexus/cors
```

This package requires PHP 8.1.

Usage
-----

[](#usage)

TODO

Configuration
-------------

[](#configuration)

### Allow-Methods

[](#allow-methods)

Default: `[]`

An array of allowed HTTP methods. These names are **case-sensitive**.

Example: `['GET', 'POST']`

### Allow-Headers

[](#allow-headers)

Default: `[]`

Example: `['Content-Type']`

### Allow-Origins

[](#allow-origins)

Default: `[]`

An array of allowed origins, in the form `scheme://hostname`.

Example: `['http://example.com', 'https://example.com']`

**This is not a replacement for proper access control measures.**

Note: An asterisk (`*`) *can* also be used to allow any origin, but as per the specification the asterisk (`*`) *cannot* be used when Allow-Credentials is `true`.

### Allow-Credentials

[](#allow-credentials)

Default: `false`

Use `true` to allow cookies to be sent with the request.

Note: Cannot be `true` when the Allow-Origin contains `"*"`.

### Expose-Headers

[](#expose-headers)

Default: `[]`

### Max-Age

[](#max-age)

Default: `0` (no cache)

Number of seconds to cache the preflight response.

Roadmap
-------

[](#roadmap)

- Benchmarks

Versioning
----------

[](#versioning)

The packages adheres to the [SemVer](http://semver.org/) specification, and there will be full backward compatibility between minor versions.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

License
-------

[](#license)

This package is released under the Apache 2.0 License. See the bundled [LICENSE](https://github.com/phpnexus/cors/blob/master/LICENSE) file for details.

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance82

Actively maintained with recent releases

Popularity20

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 98.9% 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 ~396 days

Recently: every ~322 days

Total

10

Last Release

96d ago

PHP version history (4 changes)0.1.0PHP &gt;=5.5.9

0.3.0PHP ^7.1

0.3.3PHP ^7.4|^8.1

0.3.5PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/3fd086657d547f6bf3353c72fbfc7be23b714cb00dbefde6f79a45a4b146ea61?d=identicon)[markinjapan](/maintainers/markinjapan)

---

Top Contributors

[![markinjapan](https://avatars.githubusercontent.com/u/5118865?v=4)](https://github.com/markinjapan "markinjapan (94 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

cors

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[j0k3r/php-readability

Automatic article extraction from HTML

186808.8k6](/packages/j0k3r-php-readability)[spomky-labs/pwa-bundle

Progressive Web App Manifest Generator Bundle for Symfony.

6144.4k1](/packages/spomky-labs-pwa-bundle)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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