承接 pedrosancao/laravel-cors-middleware 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

pedrosancao/laravel-cors-middleware

最新稳定版本:v0.1.1

Composer 安装命令:

composer require pedrosancao/laravel-cors-middleware

包简介

CORS middleware for Laravel 5.5 and above

README 文档

README

CORS middleware for Laravel 5.5 to 5.8 and 6.x.

Laravel 7 comes with fruitcake/laravel-cors, so we recommend you go with it.

This package is pretty simple, load configuration from .env and also handles Preflight request and custom headers.

Installation

Preferable use composer

composer require pedrosancao/laravel-cors-middleware

We use package Package Discovery so there's no need to modify any files to enable the middleware, just install and go.

Usage

Enable middleware for route:

Route::get('sample', function () {
    //
})->middleware('cors');

Configuration

You may configure allowed domains and headers.

First option is to set on .env: allowed domains with ALLOWED_CORS_DOMAINS having fallback to APP_URL and allowed header with ALLOWED_CORS_HEADERS.

To add more than one domain our header separated them with comma.

To have full control of configuration you may copy the config file with:

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

Licence

This library is release under the MIT licence.

统计信息

  • 总下载量: 77
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-05-31

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固