Download the PHP package kwxs/laravel-cors without Composer
On this page you can find all versions of the php package kwxs/laravel-cors. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download kwxs/laravel-cors
More information about kwxs/laravel-cors
Files in kwxs/laravel-cors
Download kwxs/laravel-cors
More information about kwxs/laravel-cors
Files in kwxs/laravel-cors
Vendor kwxs
Package laravel-cors
Short Description Send CORS headers in a Laravel application
License MIT
Package laravel-cors
Short Description Send CORS headers in a Laravel application
License MIT
Please rate this library. Is it a good library?
Informations about the package laravel-cors
Laravel CORS
Laravel package for CORS, with support for custom CORS profiles per route.
Installation
In your composer.json
, add this repository:
Then do composer require tenantcloud/laravel-cors
to install the package.
After, publish the config: php artisan vendor:publish
and select needed config file.
Usage
You want to use a single, global CORS per project
If you want to use a global profile, add CorsMiddleware::class
into your Http\Kernel.php
's
$middleware
. default
profile from the config will be used.
You want to use multiple different CORS profiles per route
If you need a scoped CORS, you should:
- Add wanted config to cors.php
- Add
'cors' => CorsMiddleware::class
into yourHttp\Kernel.php
's$routeMiddleware
. - Add
cors:your_profile
to route you want to have CORS on. - Add
OPTIONS
to list of supported methods for that route.
Example:
All versions of laravel-cors with dependencies
PHP Build Version
Package Version
The package kwxs/laravel-cors contains the following files
Loading the files please wait ....