hongyejia / laravel-cors
laravel Cors middleware
1.0.2
2022-03-04 02:55 UTC
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