Created
November 19, 2016 22:52
-
-
Save amouillard/61f5f3bc88e19ea5024754085f35c043 to your computer and use it in GitHub Desktop.
CORS middleware for Laravel 5.3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
class Cors | |
{ | |
public function handle($request, Closure $next) | |
{ | |
return $next($request) | |
->header('Access-Control-Allow-Origin', '*') | |
->header('Access-Control-Allow-Methods', '*') | |
->header('Access-Control-Expose-Headers', 'authorization'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment