Looking to hire Laravel developers? Try LaraJobs

laravel-cors maintained by hongyejia

Description
laravel Cors middleware
Author
Last update
2022/03/04 03:55 (dev-main)
License
Links
Downloads
26

Comments
comments powered by Disqus

框架要求

  • 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