public function handle($request, Closure $next, $guard = null) {
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Credentials: true");
header("Access-Control-Allow-Methods: *");
header('Access-Control-Allow-Headers', 'Origin ,Content-Type,Access-Token,Cookie, Accept,multipart/form-data, application/json');
header('Access-Control-Expose-Headers:*');
if($request->getMethod() === 'OPTIONS'){
$origin = $request->header('ORIGIN', '*');
header("Access-Control-Allow-Origin: $origin");
header("Access-Control-Allow-Credentials: true");
header('Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE');
header('Access-Control-Allow-Headers: Origin, Access-Control-Request-Headers, SERVER_NAME, Access-Control-Allow-Headers, cache-control, token, X-Requested-With, Content-Type, Accept, Connection, User-Agent, Cookie, X-XSRF-TOKEN');
header('Access-Control-Allow-Headers:signature');
}
return $next($request);
}
|