Skip to content
This repository has been archived by the owner on Feb 16, 2023. It is now read-only.

Commit

Permalink
Update readme.md (#179)
Browse files Browse the repository at this point in the history
* Update readme.md

* Update readme.md
  • Loading branch information
boonstoppel authored and barryvdh committed Mar 20, 2017
1 parent 9fe3dfb commit 0538aa0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,22 @@ return [
On Laravel Lumen, load your configuration file manually:

$app->configure('cors');

## Global usage for Lumen
To allow CORS for all your routes, add the `HandleCors` middleware to the global middleware

```php
$app->middleware([
\Barryvdh\Cors\HandleCors::class
```

## Group middleware for Lumen
If you want to allow CORS on a specific middleware group or route, add the HandleCors middleware to your group:

```php
$app->routeMiddleware([
'cors' => \Barryvdh\Cors\HandleCors::class,
```

## Common problems and errors (Pre Laravel 5.3)
In order for the package to work, the request has to be a valid CORS request and needs to include an "Origin" header.
Expand Down

0 comments on commit 0538aa0

Please sign in to comment.