whitecube/laravel-cookie-consent
@cookieconsentscripts and @cookieconsentview simplify frontend integration, requiring only two lines in layouts.accepted() callbacks could lead to non-compliant behavior (e.g., analytics firing without consent).config/session.php, third-party SDKs) to map to categories.vendor:publish).CookiesServiceProvider in app.php/providers.php.registerCookies() (e.g., Google Analytics, custom cookies).@cookieconsentscripts to <head> and @cookieconsentview to <body>.Cookies::facade() or DI.accepted() callback.CookiesServiceProvider, reducing scattered cookie logic.resources/lang/cookieConsent.php.php artisan lang:publish) for team collaboration.Cookies::facade()->getConsent() to inspect stored preferences.domain parameter in accepted() callbacks to share consent.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Consent cookie deleted/expired | Analytics/scripts stop working | Implement a "re-consent" prompt on missing cookie. |
| JS disabled | Modal doesn’t render | Use @cookieconsentview fallback (non-JS banner). |
Misconfigured accepted() callback |
Scripts fire without consent | Unit test callbacks with Consent mocks. |
| Multi-domain consent mismatch | Inconsistent user preferences | Use shared cookie domain (e.g., .example.com). |
| GDPR rule changes | Package becomes non-compliant | Subscribe to updates; audit annually. |
@cookieconsentscripts usage.tinker commands to inspect cookies).How can I help you explore Laravel packages today?