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

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

kwxs/laravel-cors
=================

Send CORS headers in a Laravel application

2.0.0(6y ago)0336MITPHPPHP ^7.2

Since Aug 22Pushed 6y agoCompare

[ Source](https://github.com/KWXS/laravel-cors)[ Packagist](https://packagist.org/packages/kwxs/laravel-cors)[ RSS](/packages/kwxs-laravel-cors/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (5)Used By (0)

Laravel CORS
============

[](#laravel-cors)

Laravel package for CORS, with support for custom CORS profiles per route.

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

[](#installation)

In your `composer.json`, add this repository:

```
"repositories": [
    {
        "type": "git",
        "url": "https://github.com/tenantcloud/laravel-cors"
    }
],

```

Then do `composer require tenantcloud/laravel-cors` to install the package. After, publish the config: `php artisan vendor:publish` and select needed config file.

Usage
-----

[](#usage)

### You want to use a single, global CORS per project

[](#you-want-to-use-a-single-global-cors-per-project)

If you want to use a global profile, add `CorsMiddleware::class` into your `Http\Kernel.php`'s `$middleware`. `default` profile from the config will be used.

### You want to use multiple different CORS profiles per route

[](#you-want-to-use-multiple-different-cors-profiles-per-route)

If you need a scoped CORS, you should:

1. Add wanted config to cors.php
2. Add `'cors' => CorsMiddleware::class` into your `Http\Kernel.php`'s `$routeMiddleware`.
3. Add `cors:your_profile` to route you want to have CORS on.
4. Add `OPTIONS` to list of supported methods for that route.

Example:

```
Route::match(['GET', 'OPTIONS'], '/test', 'Controller@test')->middleware('cors:test_profile');

```

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 81.8% 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 ~229 days

Total

2

Last Release

2278d ago

Major Versions

1.0.0 → 2.0.02020-04-08

PHP version history (2 changes)1.0.0PHP ^7.1

2.0.0PHP ^7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/413b481f92caa1d96de546c0417395b0ca178658d9f6ef195ae303a91d2765e5?d=identicon)[ivankolodii](/maintainers/ivankolodii)

![](https://www.gravatar.com/avatar/f8e4d651b6994a06b201654d8f7835be0dead96022dd195e013e0bac9cf46e9b?d=identicon)[chris-kwx](/maintainers/chris-kwx)

---

Top Contributors

[![oprypkhantc](https://avatars.githubusercontent.com/u/54406427?v=4)](https://github.com/oprypkhantc "oprypkhantc (9 commits)")[![ivankolodii](https://avatars.githubusercontent.com/u/35073476?v=4)](https://github.com/ivankolodii "ivankolodii (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[mateusjunges/laravel-kafka

A kafka driver for laravel

7253.6M21](/packages/mateusjunges-laravel-kafka)[illuminate/http

The Illuminate Http package.

11937.9M7.0k](/packages/illuminate-http)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)

PHPackages © 2026

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