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

Abandoned → [https://github.com/fruitcake/laravel-cors](/?search=https%3A%2F%2Fgithub.com%2Ffruitcake%2Flaravel-cors)ArchivedLibrary[HTTP &amp; Networking](/categories/http)

resultsystems/laravel-cors
==========================

Laravel cors

2.0.0(8y ago)2010.6k↓33.3%52MITPHPPHP &gt;=7.0.0

Since Mar 1Pushed 4y ago2 watchersCompare

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

READMEChangelogDependenciesVersions (5)Used By (2)

Laravel Cors
============

[](#laravel-cors)

- This package is abandoned and no longer maintained. The author suggests using the  package instead.
- Thanks for the more than 6,000 installations

Pacote abandonado pois o Laravel 7.X já tem suporte a cors nativo, use apenas se você tiver usando a versão 6.X ou abaixo.
--------------------------------------------------------------------------------------------------------------------------

[](#pacote-abandonado-pois-o-laravel-7x-já-tem-suporte-a-cors-nativo-use-apenas-se-você-tiver-usando-a-versão-6x-ou-abaixo)

Instalação
----------

[](#instalação)

[Vídeo Tutorial](https://youtu.be/6vBSI4Dz63c)

### 1. Dependência

[](#1-dependência)

Usando o [composer](https://getcomposer.org/), execute o comando a seguir para instalar automaticamente `composer.json`:

```
composer require resultsystems/laravel-cors
```

### 2. Middlewares

[](#2-middlewares)

Para utilizá-los é necessário registrá-los no seu arquivo app/Http/Kernel.php.

```
 protected $middleware = [
        // other middleware ommited
    	\ResultSystems\Cors\CorsMiddleware::class,
 ];
```

### 3. Provider (opcional)

[](#3-provider-opcional)

Selecionar os domínios permitidos no Laraver-Cors em sua aplicação Laravel, é necessário registrar o package no seu arquivo `config/app.php`. Adicione o seguinte código no fim da seção `providers`

```
// file START ommited
    'providers' => [
        // other providers ommited
        \ResultSystems\Cors\CorsServiceProvider::class,
    ],
// file END ommited
```

#### 3.1 Publicando o arquivo de configuração (somente se tiver feito o passo 3)

[](#31-publicando-o-arquivo-de-configuração-somente-se-tiver-feito-o-passo-3)

Para publicar o arquivo de configuração padrão que acompanham o package, execute o seguinte comando:

```
php artisan vendor:publish  --provider="ResultSystems\Cors\CorsServiceProvider"
```

#### 4 Configurações (somente se tiver feito o passo 3, e 3.1)

[](#4-configurações-somente-se-tiver-feito-o-passo-3-e-31)

configure o arquivo com os domínios que dejeja liberar

`config/cors.php`

Inspirado no artigo: Obrigado @vedovelli

#### 5 Bônus

[](#5-bônus)

Caso você utilize `nginx`

Adicione estas configurações no arquivo de configurações do site:

```
	location / {
		# First attempt to serve request as file, then
		# as directory, then fall back to displaying a 404.
		try_files $uri $uri/ /$is_args$args;
	     if ($request_method = 'OPTIONS') {
	        add_header 'Access-Control-Allow-Origin' '*';
	        #
	        # Om nom nom cookies
	        #
	        add_header 'Access-Control-Allow-Credentials' 'true';
	        add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
	        #
	        # Custom headers and headers various browsers *should* be OK with but aren't
	        #
	        add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Authorization,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
	        #
	        # Tell client that this pre-flight info is valid for 20 days
	        #
	        add_header 'Access-Control-Max-Age' 1728000;
	        add_header 'Content-Type' 'text/plain charset=UTF-8';
	        add_header 'Content-Length' 0;
	        return 204;
	     }
	}

```

Caso seja apache, talvez seja necessário adicionar estas linhas abaixo ao .htaccess

```

            Options -MultiViews

```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 96.2% 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 ~116 days

Total

4

Last Release

3007d ago

Major Versions

1.1.1 → 2.0.02018-02-15

PHP version history (2 changes)1.0.6PHP &gt;=5.5.9

2.0.0PHP &gt;=7.0.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/f64e8782fcd3455bf66d16fa97f5cb12f7d3d2868ba9e3476bbb87eb7ad56cb1?d=identicon)[emtudo](/maintainers/emtudo)

---

Top Contributors

[![emtudo](https://avatars.githubusercontent.com/u/191396?v=4)](https://github.com/emtudo "emtudo (25 commits)")[![jalescardoso](https://avatars.githubusercontent.com/u/10332053?v=4)](https://github.com/jalescardoso "jalescardoso (1 commits)")

---

Tags

corsframeworklaravellaravel-cors

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/resultsystems-laravel-cors/health.svg)](https://phpackages.com/packages/resultsystems-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)
