PHPackages                             ozee31/cakephp-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. ozee31/cakephp-cors

AbandonedArchivedCakephp-plugin[HTTP &amp; Networking](/categories/http)

ozee31/cakephp-cors
===================

A CakePHP (3.3.x) plugin for activate cors domain in your application

v2.0.0(6y ago)43467.2k↓17.8%30[5 issues](https://github.com/ozee31/cakephp-cors/issues)[1 PRs](https://github.com/ozee31/cakephp-cors/pulls)PHPPHP &gt;=7.2.0

Since Nov 9Pushed 4y ago5 watchersCompare

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

READMEChangelog (10)Dependencies (5)Versions (15)Used By (0)

cakephp-cors
============

[](#cakephp-cors)

[![Build Status](https://camo.githubusercontent.com/478444070dc42c5831eb333891690cf319d64a9180e410c41e0fda2a8bc747f8/68747470733a2f2f7472617669732d63692e6f72672f6f7a656533312f63616b657068702d636f72732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ozee31/cakephp-cors)

A CakePHP (4+) plugin for activate cors domain in your application with [Middleware](http://book.cakephp.org/3.0/en/controllers/middleware.html).

[Learn more about CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS)

**For cake 3.3+ use branch [cake-3](https://github.com/ozee31/cakephp-cors/tree/cake-3)**

Requirements
------------

[](#requirements)

- PHP version 7.2 or higher
- CakePhp 4.0 or higher

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

[](#installation)

You can install this plugin into your CakePHP application using [composer](http://getcomposer.org).

The recommended way to install composer packages is:

```
composer require ozee31/cakephp-cors

```

Quick Start
-----------

[](#quick-start)

Loading the Plugin

```
// In src/Application.php
public function bootstrap(): void
{
    // code ...
    $this->addPlugin('Cors');
}
```

By default the plugin authorize cors for all origins, all methods and all headers and caches all for one day.

Configuration
-------------

[](#configuration)

### Default configuration

[](#default-configuration)

```
