hongyejia/laravel-cors

laravel Cors middleware

1.0.2 2022-03-04 02:55 UTC

This package is auto-updated.

Last update: 2024-10-04 08:57:05 UTC


README

laravel Cors middleware.

框架要求

  • Laravel >= 5.1

安装

$ composer require hongyejia/laravel-cors -vvv

配置

Laravel 应用

  1. config/app.php 注册 ServiceProvider
'providers' => [
    // ...
    Hongyejia\LaravelCors\ServiceProvider::class,
],
  1. 创建配置文件:
php artisan vendor:publish --provider="Hongyejia\LaravelCors\ServiceProvider"
  1. 修改应用根目录下的 config/cors.php 中对应的参数即可。

使用

1.在app/Http/kernel.php 加入 中间件

 protected $middleware = [
 	// ....
 	\Hongyejia\LaravelCors\AllowCrossDomain:class
 ]

Contributing

You can contribute in one of three ways:

  1. File bug reports using the issue tracker.
  2. Answer questions or fix bugs on the issue tracker.
  3. Contribute new features or update the wiki.

The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.

License

MIT