<?php

namespace App\Http\Middleware;

use Closure;

class Cors
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{

header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: Content-Type, X-Auth-Token, Authorization, Origin');
header('Access-Control-Allow-Methods: POST, PUT,GET');
header('Access-Control-Allow-Credentials:true');
return $next($request);
// ->header('Access-Control-Allow-Origin','https://test.iflexviva.com')
// ->header('Access-Control-Allow-Methods','GET, POST, PUT, DELETE, OPTIONS')
// ->header('Access-Control-Allow-Headers','X-Requested-With, Content-Type, X-Token-Auth, Authorization')
// ->header('Access-Control-Allow-Credentials','true');
}

}