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

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

tenantcloud/laravel-cors
========================

Send CORS headers in a Laravel application

v3.0.0(10mo ago)154.6k↓30%1MITPHPPHP &gt;=8.3CI passing

Since Aug 22Pushed 10mo ago5 watchersCompare

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

READMEChangelog (8)Dependencies (11)Versions (12)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

49

—

FairBetter than 95% of packages

Maintenance54

Moderate activity, may be stable

Popularity30

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 61.3% 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 ~237 days

Recently: every ~182 days

Total

10

Last Release

320d ago

Major Versions

1.0.0 → 2.0.02020-04-08

v2.4.1 → v3.0.02025-07-03

PHP version history (6 changes)1.0.0PHP ^7.1

2.0.0PHP ^7.2

2.1.0PHP &gt;=7.4

v2.3.0PHP &gt;=8.1

v2.4.0PHP &gt;=8.2

v3.0.0PHP &gt;=8.3

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/81579ce1a873c490b1a0d5dc34590cabe83e42997112e083f881ee8e218ed44d?d=identicon)[BrunIF](/maintainers/BrunIF)

![](https://www.gravatar.com/avatar/08f421d0127cd5dd06158a3ef66dee8fa7f6589677349c379be87c46d3acc99c?d=identicon)[tcmbilozub](/maintainers/tcmbilozub)

![](https://www.gravatar.com/avatar/216426b713fa88a88c59ae755fa9c5e5e73a88fce79903c3234a9f21af8547dc?d=identicon)[oprypkhantc](/maintainers/oprypkhantc)

---

Top Contributors

[![oprypkhantc](https://avatars.githubusercontent.com/u/54406427?v=4)](https://github.com/oprypkhantc "oprypkhantc (19 commits)")[![tcmbilozub](https://avatars.githubusercontent.com/u/35073636?v=4)](https://github.com/tcmbilozub "tcmbilozub (4 commits)")[![package-sync[bot]](https://avatars.githubusercontent.com/u/35073549?v=4)](https://github.com/package-sync[bot] "package-sync[bot] (3 commits)")[![semantic-release-bot](https://avatars.githubusercontent.com/u/32174276?v=4)](https://github.com/semantic-release-bot "semantic-release-bot (3 commits)")[![KlebanAndrew](https://avatars.githubusercontent.com/u/6851969?v=4)](https://github.com/KlebanAndrew "KlebanAndrew (2 commits)")

---

Tags

laravelpackagephp

###  Code Quality

TestsPest

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[mateusjunges/laravel-kafka

A kafka driver for laravel

7163.1M17](/packages/mateusjunges-laravel-kafka)[pusher/pusher-http-laravel

\[DEPRECATED\] A Pusher bridge for Laravel

400509.0k3](/packages/pusher-pusher-http-laravel)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)[muhammadhuzaifa/telescope-guzzle-watcher

Telescope Guzzle Watcher provide a custom watcher for intercepting http requests made via guzzlehttp/guzzle php library. The package uses the on\_stats request option for extracting the request/response data. The watcher intercept and log the request into the Laravel Telescope HTTP Client Watcher.

98239.8k1](/packages/muhammadhuzaifa-telescope-guzzle-watcher)[tomschlick/laravel-http2-server-push

A middleware package for Laravel to enable server push for your script, style, and image assets.

16467.2k](/packages/tomschlick-laravel-http2-server-push)[dragon-code/laravel-http-logger

Logging incoming HTTP requests

319.8k3](/packages/dragon-code-laravel-http-logger)

PHPackages © 2026

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