eveltic/cookie-bundle
Symfony bundle for managing GDPR/AEPD-compliant user cookie consent. Configure technical, preference, analytics, and ad categories, set expiration periods, and support light, dark, or auto themes. Includes Twig helpers, Doctrine integration, ajax-driven UI, consent checking, versioning, and CLI arch...
Architecture fit — the framework mismatch is the headline. Despite the "Laravel/PHP package" framing, eveltic/cookie-bundle is a Symfony bundle, not a Laravel package. It is built around Symfony conventions: a DI extension with a configuration tree, Twig templates and Twig extensions, Symfony routing/controllers for the AJAX consent endpoints, the Symfony Translator for multilingual strings, and event subscribers. None of that autoloads or boots inside a Laravel application without a compatibility layer. In a Symfony codebase this is a low-effort drop-in; in a Laravel codebase it is a reference implementation to port, not a dependency to install.
What the package actually is. Stripping the README down, the deliverable is: (a) a configurable consent banner UI with four default categories (technical, preferences, analytics, ads), theme support (light/dark/auto), and multilingual copy; (b) a preferences modal with per-category toggles; (c) a persistent "retract consent" affordance (floating button plus a consent-details view); (d) AJAX endpoints to persist and update preferences without a page reload; (e) configurable cookie expiration. That is a UI and preference-capture layer, not a full consent management platform.
Integration feasibility by hosting framework:
| Scenario | Effort | Notes |
|---|---|---|
| Symfony 6/7 app | Low (hours–1 day) | Composer require, register bundle, configure categories, render Twig partial |
| Laravel app | Medium–high (1–3 weeks) | Reimplement routes/controllers, convert Twig→Blade, port config to config/, rewire translations to Laravel's translator, re-implement asset publishing |
| Non-Symfony / mixed | High | Effectively a fork |
Technical risk:
localStorage/first-party cookies, you have a functional UX but weak evidentiary value. Ask explicitly whether there is a server-side consent log and what its retention policy is.Key questions to put to the maintainer or resolve by code review:
Stack fit. Resolve the framework question before anything else. If the target is Laravel — which the brief implies — treat this repository as donor code, not a dependency. Its value is the UX patterns (retract-consent floating button, consent-details drawer, category model), the copy, and the DOM/JS structure. That value is real and reusable; the Symfony plumbing is not.
Options, ranked:
config/cookie-consent.php, implement two or three routes in routes/web.php with a thin controller, reuse the CSS/JS assets, and add a consent_events table. Roughly 1–3 weeks for one developer including tests. Recommended if Laravel and you want no ongoing vendor fee.Migration path. If there is no existing CMP, this is greenfield — no data migration, just a banner-version field so future policy changes can force re-consent. If replacing an existing CMP, do not attempt to import old consent records into the new schema; the legal basis and category mapping rarely line up. Plan a clean re-prompt on a dated cutover, and keep the old records read-only for the limitation period.
Compatibility. Verify composer.json constraints against your PHP runtime and Symfony/Twig versions before committing. On the browser side the risk is CSP and ad-blockers rather than legacy browsers. If assets are served through a CDN, confirm cache-busting on banner-version changes.
Sequencing:
Maintenance. Assume ownership. Budget roughly 1–2 engineer-days per quarter for dependency bumps and a yearly review against AEPD/GDPR guidance changes, plus translation upkeep for each locale you ship. Track the upstream repo; if it goes quiet for two release cycles, formally fork and record that decision.
Support. No vendor, no SLA, GitHub issues only. Stand up an internal runbook covering: how to add a category, how to add a locale, how to bump the policy version and trigger re-consent, and what to do if the banner fails to render. Name a single owning team — consent infrastructure fails organizationally when it is "everyone's."
Scaling. Runtime cost is negligible: static CSS/JS plus infrequent AJAX writes at consent time. The real scaling concerns are (a) write volume and bot noise on the consent endpoint — rate-limit it and consider dropping obvious bot traffic; (b) CDN staleness serving an outdated banner after a policy change; (c) consent-record table growth — partition or archive per your retention policy.
Failure modes to design against:
Ramp-up. A Laravel team needs 1–2 days to read the Symfony code comfortably (bundle extension, Twig, service tags) — mostly to distinguish reusable assets from framework glue. Add half a day of consent-law literacy for whoever owns the integration: the failure mode here is not technical, it is shipping a technically correct banner that captures the wrong thing. Total onboarding for a port: roughly one engineer-week before productive output, against a 1–3 week implementation.
How can I help you explore Laravel packages today?