norotaro/wn-cors-plugin

Installs: 1 036

Dependents: 0

Suggesters: 0

Security: 0

Stars: 4

Watchers: 2

Forks: 1

Open Issues: 0

Type:winter-plugin

v1.0.0 2021-07-23 20:34 UTC

This package is auto-updated.

Last update: 2024-10-24 03:32:37 UTC


README

Implements fuitcake/laravel-cors package for WinterCMS.

Installation

Run the following command in a project's root directory:

composer require norotaro/wn-cors-plugin
php artisan winter:up

About

This plugin install the fruitcake/laravel-cors package and register it to the service container.

Configuration

You have two options to configure this plugin. Feel free to choose the one that is most comfortable for you.

Publishing the configuration file

You can publish the config to copy the file to config folder of WinterCMS.

php artisan vendor:publish --tag="cors"

For more information you can read the instructions of laravel-cors package.

Using backend configuration

In the WinterCMS backend settings section (Settings > CORS > CORS Settings) you can enable Backend Configuration. There you can set the same parameters as in the config/cors.php file.

Note: If you enable this setting, the configuration set in the config/cors.php file will be ignored.

Note: If you choose this option to configure the plugin, you do not need to publish the configuration file described in the previous point.

Package docs

Here you can read the documentation of the package installed by this plugin: https://github.com/fruitcake/laravel-cors#cors-middleware-for-laravel