mrshanebarron/cookie-consent
Laravel package for GDPR-friendly cookie consent. Adds a configurable consent banner, cookie categories, and middleware to block scripts until visitors opt in. Publishable config and views make it easy to match your app's design and store consent records.
mrshanebarron/cookie-consent is a thin, single-purpose Laravel UI package: a configurable GDPR consent banner, a consent cookie, and a gating helper for analytics/tracking scripts. It is not a consent management platform. From a TPM standpoint, evaluate it as a UI dependency with compliance implications, not as infrastructure.
composer require, publish config/views, drop the component into the layout, clear caches. Middleware-based injection is the riskier of the two modes — response middleware that appends markup must be scoped to HTML responses and excluded from API routes, JSON, redirects, downloads, and streamed responses.composer.json rather than a caret range; a 1.0.x class-rename patch demonstrates that minor releases may not be safe. Regenerate the autoloader and clear config/view/route caches after install. Test on the target PHP matrix and on a case-sensitive filesystem. Verify middleware injection does not alter responses on API, health-check, and webhook routes.ConsentService/view-model interface so the vendor can be swapped without touching call sites; (5) staged rollout with a market flag; (6) publish internal usage docs with the corrected PascalCase names.Class not found after the PascalCase rename; banner suppressed by an aggressive ad blocker, leaving users with no way to consent (a compliance failure, not just a UX one); cookie rejected by browser privacy settings or third-party-cookie phase-out causing repeated prompts; cache poisoning of banner state at the edge; and the systemic failure — banner shows, tracking still fires, giving false assurance of compliance.How can I help you explore Laravel packages today?