$relayPath = base_path($cpath) . '/' . $path;
$user = Auth::guard('client')->user();
- if ($path === 'index.html' && $user) {
+ if ($path === 'index.html' && $user !== null) {
$html = file_get_contents($relayPath);
- $html = str_replace('</head>', '<script>MATOMO_USER_ID="' . $user->email . '";</script></head>', $html);
+ $html = str_replace('<head>', '<head><script type="text/javascript">var MATOMO_USER_ID="' . $user->email . '";</script>', $html);
return response($html)->header('Content-Type', 'text/html');
-
}
return XSendFileController::sendfileNoCache($relayPath);