Skip to content

Example middleware for laravel CORS headers if request method OPTIONS

License

Notifications You must be signed in to change notification settings

sergiobelya/laravel-options-cors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

laravel-options-cors

Example middleware for laravel CORS headers if request method OPTIONS. Working in Laravel >= 5.4, maybe 5.3.

Using

For use OptionsCorsResponse middleware, copy it for your application and enable it in Kernel::$middleware array (but not in Kernel::$routeMiddleware, see laravel/framework#19938).

For example

// App\Http\Kernel
// ...
protected $middleware = [
    // ...
    \App\Http\Middleware\OptionsCorsResponse::class,
];

Сhange $headers in OptionsCorsResponse if necessary.

About

Example middleware for laravel CORS headers if request method OPTIONS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages