Download the PHP package dragonfire1119/cors-lumen without Composer
On this page you can find all versions of the php package dragonfire1119/cors-lumen. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dragonfire1119/cors-lumen
More information about dragonfire1119/cors-lumen
Files in dragonfire1119/cors-lumen
Package cors-lumen
Short Description Cross-origin resource sharing (CORS) middleware & ServiceProvider for Lumen micro-framework.
License MIT
Homepage https://github.com/dragonfire1119/cors-lumen
Informations about the package cors-lumen
CORS for Lumen
Cross-origin resource sharing (CORS) Middleware for Lumen micro-framework.
Install with Composer
Run composer require "dragonfire1119/cors-lumen:dev-master"
to install cors-lumen.
Usage
Add CORS ServiceProvider
If you want to allow OPTIONS method then your going to need to enable the CorsServiceProvider in the bootstrap/app.php
file.
Global CORS
If you want CORS enabled for every HTTP request to your application, simply list the middleware class Dragonfire1119\Cors\Middleware\CorsMiddleware
in the $app->middleware() call of your bootstrap/app.php
file.
CORS for Routes
If you would like to enable CORS to specific routes, you should first assign the cors
middleware a short-hand key in your bootstrap/app.php
file.
Then, you use the key in the route options array.
More info. - http://lumen.laravel.com/docs/middleware#registering-middleware
Contributing
If you have a change fork it & make a pull request. :)
License
Released under the MIT, see LICENSE.