hongyejia / laravel-cors
laravel Cors middleware
Installs: 23
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/hongyejia/laravel-cors
README
laravel Cors middleware.
框架要求
- Laravel >= 5.1
安装
$ composer require hongyejia/laravel-cors -vvv
配置
Laravel 应用
- 在
config/app.php注册 ServiceProvider
'providers' => [ // ... Hongyejia\LaravelCors\ServiceProvider::class, ],
- 创建配置文件:
php artisan vendor:publish --provider="Hongyejia\LaravelCors\ServiceProvider"
- 修改应用根目录下的
config/cors.php中对应的参数即可。
使用
1.在app/Http/kernel.php 加入 中间件
protected $middleware = [ // .... \Hongyejia\LaravelCors\AllowCrossDomain:class ]
Contributing
You can contribute in one of three ways:
- File bug reports using the issue tracker.
- Answer questions or fix bugs on the issue tracker.
- 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