Open nourishingafrica opened 1 month ago
function handleAcceptEssentials(e) {
e.preventDefault();
if (window.LaravelCookieConsent && typeof window.LaravelCookieConsent.acceptEssentials === 'function') {
window.LaravelCookieConsent.acceptEssentials();
hideCookiePolicy();
} else {
console.error('LaravelCookieConsent.acceptEssentials is not available');
}
}``
Looks like the JS isn't included. Did you load the scripts into the page and check you don't have custom rules preventing them to run correctly?
I used the blade directives just as was stated in the guide. Although I have a vue.js app.js script on the page. I don't know if that's causing the conflict
Could be, can you see the JS file in the browser's network tab ?
I had a similar issue and found a solution, maybe this helps you: #64
Try to update the url prefix in cookieconsent.php to 'prefix' => 'cookieconsent',
I get "window.LaravelCookieConsent is undefined" in console.log when i click on any button and it doesn't work