pierre-brtrd/cookie-consent-bundle
A Symfony bundle for adding a configurable cookie consent banner to your application, letting visitors accept or reject cookies and helping you meet GDPR and ePrivacy requirements with minimal setup. Provides templates, configuration options, and JavaScript hooks for customizing consent behavior.
What this actually is. Despite being filed in this evaluation as a "Laravel/PHP package," pierre-brtrd/cookie-consent-bundle is a Symfony bundle. That distinction drives every conclusion below. It ships Symfony-style artifacts: a DI extension and configuration tree, Twig templates for the banner, and Symfony-idiomatic persistence of visitor choices (cookie-based). It is not a Laravel package, has no extra.laravel.providers entry by any evidence in the sources, and ships no Blade views.
Architecture fit. Poor as a direct dependency for a Laravel application, reasonable as a reference implementation. The domain model it encodes — consent categories (necessary / analytics / marketing), opt-in gating of non-essential scripts, persistence of the choice so the banner is not re-shown, configuration-driven category definitions — is exactly the model a Laravel app needs. The value to us is roughly 20% code and 80% a working, MIT-licensed specification of the consent flow at a scale we can read end-to-end in an afternoon. The Symfony plumbing (bundle registration, config tree, Twig renderer) is not reusable in Laravel and should not be fought.
Integration feasibility. Medium-low for "install and go," high for "adapt in a spike." Concretely:
config/cookie-consent.php array. Mechanical, a few hours.ConsentManager singleton, as the existing dev assessment recommends.Technical risk. Elevated and concentrated in maturity, not in complexity:
true, pre-checked boxes, or gating that misses inline scripts are the three classic failure modes and all are easy to ship accidentally.Key questions for the spike owner.
SameSite/Secure configuration, and JSON payload shape — and is it stable across the 1.0.x line?The honest read: this is a 1-star, single-maintainer Symfony bundle. We should treat it as a vetted starting point to copy patterns from, not as a dependency to pin and trust. If the spike shows the gating logic is sound and small, vendor the relevant pieces into our own app/Support/Consent namespace with attribution, and drop the Composer dependency entirely.
Stack fit. Symfony bundle → Laravel app is a port, not an integration. Do not attempt to make the Symfony bundle boot inside Laravel's container; the DI extension, config tree, and Twig environment have no counterparts and any shim will be more code than a clean reimplementation. The correct mental model is: read the package, extract the consent semantics, write ~200 lines of Laravel-native code.
Migration path. Two viable paths, and the choice is a TPM call driven by timeline:
CookieConsentServiceProvider in our own namespace that binds a thin adapter over the package's classes, reimplement the banner in Blade, and gate scripts in Blade directives. Accepts a permanent coupling to a single-maintainer package and a public API that is "likely stable, not guaranteed." Only justified if the spike deadline is measured in days.Compatibility. Three things to verify before either path is approved:
extra.laravel block in composer.json. Treat Symfony-only as the default assumption.resources/ — if a build step or a framework widget is present, that is a hidden cost against a Blade-only frontend.Sequencing. Six steps, in order, each independently verifiable:
ConsentManager (bound singleton, reads the cookie, exposes allows(string $category)) plus the persistence contract with policy_version and a timestamp. Everything else depends on this interface, so freeze it before the banner exists.<script type="text/plain" data-consent="analytics"> plus a small activation shim. Verify with a network trace that no non-essential request fires before opt-in.Non-negotiables during sequencing. necessary cookies (session, CSRF, auth) must never be gated — that breaks login in a way that looks like an unrelated bug. Any full-page cache must exclude consent-dependent fragments or resolve consent client-side. And the cookie read must live in the adapter, never scattered across Blade templates, so a future swap to a commercial CMP is a contained change.
Maintenance. The dominant cost is not the code — it is the compliance surface, which never stops moving. Banner copy, category definitions, and retention rules change with legal guidance and per-locale interpretation. Under Path A we carry that work plus ownership risk on an unmaintained upstream; under Path B we carry it alone but with no upgrade-shock exposure. Either way, budget a recurring quarterly review of consent copy and category taxonomy, owned by product with legal sign-off. The code itself, once written, is small and stable.
Support. No vendor, no SLA, no security contact, no issue responsiveness to point at during an inquiry or an incident. Legal and the DPO will ask "who supports this?" and the only defensible answer is "we do." That is acceptable if stated up front; it is a problem if discovered during a regulatory review. There is also a documentation gap — the sources here are a README, a bare changelog link, and no visible test suite — which means onboarding is source-reading, not docs-reading.
Scaling. Negligible in the conventional sense: this is a cookie read plus conditional markup, and the cost does not grow with traffic. The scaling concern is organizational, not technical — multi-brand, multi-domain, and multi-locale surfaces multiply configuration and copy-review effort, and a self-hosted banner gives no config UI, no geo-targeting without deploys, and no tag templates. If the roadmap includes regional banner variation, A/B testing accept rates, or several brands, this approach starts to look like building a CMP. Set a threshold now for when that triggers a buy decision.
Failure modes to instrument for.
<script> tags in Blade.SameSite/Secure mismatch on local HTTP — will surface as "it never remembers my choice" and burn debugging time if not anticipated in the runbook.Ramp-up. Low for any Laravel developer — reading, adapting, and testing this is a one-to-two-day task, which is precisely why Path B is viable. The real ramp-up is cross-functional: legal must understand what the mechanism does and does not provide. The framing to reinforce is that the package delivers the mechanism (banner, granular categories, persistence, withdrawal, audit record) and not the policy (category definitions, copy per locale, retention period, sufficiency of evidence). Plan for a legal review that runs on calendar time, not engineering time, and do not let the code completion create the impression that compliance is done.
How can I help you explore Laravel packages today?