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

ActiveCakephp-plugin

sergioooo/cakephp-cors
======================

CakePHP 4+ plugin for activating CORS in your application

01PHP

Since Mar 30Pushed 3y agoCompare

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

READMEChangelogDependenciesVersions (1)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)

```
