PHPackages                             jzaaa/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. jzaaa/cakephp-cors

ActiveCakephp-plugin[Utility &amp; Helpers](/categories/utility)

jzaaa/cakephp-cors
==================

A CakePHP 5 plugin for activate cors domain in your application

v5.0.0(2y ago)134MITPHPPHP &gt;=8.1

Since Aug 24Pushed 1y agoCompare

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

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

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

[](#cakephp-cors)

A CakePHP (5+) plugin for activate cors domain in your application with [Middleware](https://book.cakephp.org/5/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 8.1 or higher
- CakePhp 5.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 jzaaa/cakephp-cors

```

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

[](#quick-start)

Loading the Plugin

```
// In src/Application.php
use Cors\CorsPlugin;

public function bootstrap(): void
{
    // code ...
    $this->addPlugin(CorsPlugin::class);
}
```

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)

```
