<?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', '*')
        return $next($request)
                            ->header('X-Frame-Options', 'SAMEORIGIN')		
                            ->header('Access-Control-Allow-Headers','Content-Type, x-xsrf-token')
                            ->header('Access-Control-Allow-Headers','Content-Type, x-csrf-token')
                            ->header('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS');
    }
}
