coolephp/cors

Adds CORS (Cross-Origin Resource Sharing) headers support in Coole application. - 在 Coole 应用程序中添加 CORS(跨源资源共享)头支持。

Fund package maintenance!
Wechat

v1.0.0 2021-06-05 08:45 UTC

This package is auto-updated.

Last update: 2024-12-05 19:25:25 UTC


README

简体中文 | ENGLISH

Adds CORS (Cross-Origin Resource Sharing) headers support in Coole application. - 在 Coole 应用程序中添加 CORS(跨源资源共享)头支持。

Tests Check & fix styling codecov Latest Stable Version Total Downloads License

Requirement

  • PHP >= 7.2

Installation

$ composer require coolephp/cors -vvv

Usage

  1. Copy cors/config/cors.php to coole-skeleton/config/cors.php.
  2. Config \Coole\Cors\Cors::class middleware.
<?php

return [
    /*
     * App 名称
     */
    'name' => env('APP_NAME', 'Coole'),

    /*
     * 全局中间件
     */
    'middleware' => [
        ...
        \Coole\Cors\Cors::class
        ...
    ],
];

Testing

$ composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.