Spatie\CookieConsent\CookieConsentMiddleware::addCookieConsentScriptToResponse PHP Method

addCookieConsentScriptToResponse() protected method

protected addCookieConsentScriptToResponse ( Illuminate\Http\Response $response )
$response Illuminate\Http\Response
    protected function addCookieConsentScriptToResponse(Response $response)
    {
        $content = $response->getContent();
        $closingBodyTagPosition = $this->getLastClosingBodyTagPosition($content);
        $content = '' . substr($content, 0, $closingBodyTagPosition) . view('cookieConsent::index')->render() . substr($content, $closingBodyTagPosition);
        return $response->setContent($content);
    }