filter(); if ($iframeHosts->count() > 0) { config()->set('session.same_site', 'none'); } $iframeHosts->prepend("'self'"); $response = $next($request); $cspValue = 'frame-ancestors ' . $iframeHosts->join(' '); $response->headers->set('Content-Security-Policy', $cspValue); return $response; } }