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 1mo ago

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 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

1531d 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

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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