rlSDK = new SDK\RabbitLoader($licenseKey, $cacheDir); } public function handle($request, Closure $next) { $response = $next($request); if ($response instanceof \Illuminate\Http\Response) { $content = $response->getContent(); $this->setCanonical($content); $response->setContent($content); } $this->rlSDK->process(); return $response; } private function setCanonical(&$html) { $canURL = URL::current(); // Belirli URL'ler için metatag eklemesini atla if (!empty($canURL) && !$this->shouldSkipCanonical($canURL)) { $metaTag = ""; $html = str_ireplace('', $metaTag . '', $html, $replaced); } } private function shouldSkipCanonical($url) { $skipPaths = ['/w/indensi']; foreach ($skipPaths as $path) { if ($this->startsWith($url, url($path))) { return true; } } return false; } private function startsWith($string, $startString) { $len = strlen($startString); return (substr($string, 0, $len) === $startString); } }