composer require alteis/hagreed-bundle
.env
Add your Hagreed token:
HAGREED_TOKEN="your-token-from-hagreed.com"
config/bundles.php:
Alteis\HagreedBundle\AlteisHagreedBundle::class => ['all' => true],
<head>
{{ header_hagreed() }}
</head>
<body>
{{ body_end_hagreed() }}
</body>
<a href="javascript:window.hagreedBundle.displayBanner()">Manage Cookies</a>
alteis_hagreed.yaml with:
alteis_hagreed:
token: '%env(HAGREED_TOKEN)%'
timeout: 5000 # Auto-show delay (ms)
turbo: true # If using Hotwire Turbo
cookies:
- id: analytics
name: "Analytics"
category: STATISTICS
link: "https://example.com/privacy"
consents_form_list:
- id: contact_form
title: "Data Processing"
purposes:
- slug: "marketing"
name: "Receive newsletters"
mandatory: false
$consents = $this->apiHagreed->exportConsents($userEmail);
turbo: true to avoid banner reloading on SPA transitions.force_lang: true or auto-detect with lang: fr|en.turbo: true in config and ensure importmap.php includes:
'@tizy/hagreed/hagreed.js' => ['version' => '1.2.7'],
HAGREED_TOKEN is invalid.php bin/console debug:config alteis_hagreed
SameSite and Domain attributes in Hagreed’s dashboard.ApiHagreedInterface to test endpoints:
$this->apiHagreed->exportConsents('test@example.com');
php bin/console cache:clear
templates/alteis_hagreed/ in your bundle to modify banner UI.hagreed.consent.saved).timeout: '%env(int:HAGREED_TIMEOUT)%'
How can I help you explore Laravel packages today?