I've got a problem with setting up Cors on Laravel.
Here is my middleware Cors.php:
public function handle($request, Closure $next)
{
return $next($request)
->header('Access-Control-Allow-Origin', '*')
->header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS')
->header('Access-Control-Allow-Headers', 'X-Requested-With, Content-Type, X-Token-Auth, Authorization');
}
I've tried within my rest client it working perfectly. I can see the headers. but when i tried to my front end (Angular) I don't get that response.
Before this i use Cors Package by barryvdh but it still not support laravel 5.2
What should I add to make it working?