urls; foreach ($paths as $path) { if ($path !== '/') { $path = trim($path, '/'); } if ($request->fullUrlIs($path) || $request->is($path)) { return $response; } } $response->header('Access-Control-Allow-Origin', '*'); $response->header('Access-Control-Allow-Methods', '*'); $response->header('Access-Control-Allow-Headers', 'Content-Type, Authorization, X-Requested-With'); return $response; } }