PHPackages                             hongyejia/laravel-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. hongyejia/laravel-cors

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

hongyejia/laravel-cors
======================

laravel Cors middleware

1.0.2(4y ago)024MITPHP

Since Feb 18Pushed 4y ago1 watchersCompare

[ Source](https://github.com/hongyejia/laravel-cors)[ Packagist](https://packagist.org/packages/hongyejia/laravel-cors)[ RSS](/packages/hongyejia-laravel-cors/feed)WikiDiscussions main Synced yesterday

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

 laravel-cors
==============

[](#-laravel-cors-)

 laravel Cors middleware.

框架要求
----

[](#框架要求)

- Laravel &gt;= 5.1

安装
--

[](#安装)

```
$ composer require hongyejia/laravel-cors -vvv
```

配置
--

[](#配置)

### Laravel 应用

[](#laravel-应用)

1. 在 `config/app.php` 注册 ServiceProvider

```
'providers' => [
    // ...
    Hongyejia\LaravelCors\ServiceProvider::class,
],
```

2. 创建配置文件：

```
php artisan vendor:publish --provider="Hongyejia\LaravelCors\ServiceProvider"
```

3. 修改应用根目录下的 `config/cors.php` 中对应的参数即可。

使用
--

[](#使用)

1.在`app/Http/kernel.php` 加入 中间件

```
 protected $middleware = [
 	// ....
 	\Hongyejia\LaravelCors\AllowCrossDomain:class
 ]
```

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

[](#contributing)

You can contribute in one of three ways:

1. File bug reports using the [issue tracker](https://github.com/hongyejia/laravel-cors/issues).
2. Answer questions or fix bugs on the [issue tracker](https://github.com/hongyejia/laravel-cors/issues).
3. Contribute new features or update the wiki.

*The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.*

License
-------

[](#license)

MIT

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

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

Every ~13 days

Total

2

Last Release

1584d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/91786c1757265c80d0ab7d74391b26fcd5aed519635ac478b3e8711f798d0813?d=identicon)[hongyejia](/maintainers/hongyejia)

---

Top Contributors

[![hongyejia](https://avatars.githubusercontent.com/u/45444926?v=4)](https://github.com/hongyejia "hongyejia (2 commits)")

### Embed Badge

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

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

###  Alternatives

[php-http/cache-plugin

PSR-6 Cache plugin for HTTPlug

25126.1M82](/packages/php-http-cache-plugin)[illuminate/http

The Illuminate Http package.

11937.9M6.9k](/packages/illuminate-http)[rdkafka/rdkafka

A PHP extension for Kafka

2.2k24.3k1](/packages/rdkafka-rdkafka)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[mezzio/mezzio-router

Router subcomponent for Mezzio

265.4M92](/packages/mezzio-mezzio-router)[serpapi/google-search-results-php

Get Google, Bing, Baidu, Ebay, Yahoo, Yandex, Home depot, Naver, Apple, Duckduckgo, Youtube search results via SerpApi.com

69127.2k](/packages/serpapi-google-search-results-php)

PHPackages © 2026

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