PHPackages                             nhzex/think-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. nhzex/think-cors

Abandoned → [zxin/think-cors](/?search=zxin%2Fthink-cors)Library[Utility &amp; Helpers](/categories/utility)

nhzex/think-cors
================

v3.1.0(1y ago)2563Apache-2.0PHPPHP ^7.4|^8.0

Since Apr 9Pushed 1y ago1 watchersCompare

[ Source](https://github.com/NHZEX/think-cors)[ Packagist](https://packagist.org/packages/nhzex/think-cors)[ RSS](/packages/nhzex-think-cors/feed)WikiDiscussions master Synced yesterday

READMEChangelog (5)Dependencies (6)Versions (13)Used By (0)

ThinkPHP 6.1、8.0 - CORS 跨域控制扩展
==============================

[](#thinkphp-6180---cors-跨域控制扩展)

### 全局启用

[](#全局启用)

- 配置服务注册 (app/service.php)：`\Zxin\Think\Cors\Service::class`

### 局部启用

[](#局部启用)

1. 配置服务注册 (app/service.php)：`\Zxin\Think\Cors\Service::class`
2. 禁用自动注册中间件：`config.cors.auto_register_middleware => false`
3. 注册中间件：`\Zxin\Think\Cors\CorsMiddleware::class`
4. 确保优先级：`config.middleware.priority`

代码引用
----

[](#代码引用)

- [asm89/stack-cors](https://github.com/asm89/stack-cors)

TODO
----

[](#todo)

- 新的参考跟踪 [fruitcake/php-cors](https://github.com/fruitcake/php-cors)

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance45

Moderate activity, may be stable

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity68

Established project with proven stability

 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

Every ~163 days

Recently: every ~368 days

Total

12

Last Release

429d ago

Major Versions

v1.x-dev → v2.0.02020-05-12

v2.1.1 → v3.0.02023-08-11

PHP version history (3 changes)v1.0.0PHP ^7.1

v2.0.2PHP ^7.1|^8.0

v3.0.0PHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/4de65936ae77499b5393e7c4d094ea6adef938925d4ad806e52be91069b00165?d=identicon)[NHZEX](/maintainers/NHZEX)

---

Top Contributors

[![NHZEX](https://avatars.githubusercontent.com/u/14545600?v=4)](https://github.com/NHZEX "NHZEX (25 commits)")

---

Tags

corsthinkphpthinkphp6

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[liliuwei/thinkphp-jump

适用于thinkphp6.0的跳转扩展

2874.4k1](/packages/liliuwei-thinkphp-jump)[xiaodi/think-pullword

ThinkPHP 分词/抽词 扩展包

5512.1k](/packages/xiaodi-think-pullword)[xiaodi/think-pinyin

ThinkPHP 中文转拼音扩展包

344.6k](/packages/xiaodi-think-pinyin)

PHPackages © 2026

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