- How do I install doublethreedigital/cookie-notice in a Laravel app?
- Install it with Composer using composer require doublethreedigital/cookie-notice. Then publish the package config, views and assets with the vendor:publish command documented by the package, and place the provided Blade component in your main layout. Most teams can complete the basic setup in under an hour if they already know Blade.
- Which Laravel and PHP versions does cookie-notice support?
- The package is built for Laravel Blade applications and its exact PHP and Laravel constraints are declared in the package composer.json. Check those constraints against your application before requiring it, especially on older Laravel versions. For long-term planning, confirm the maintainer's roadmap for the next Laravel major release.
- How do I customize the cookie notice message, buttons and styling?
- Publish the package config and Blade views, then edit the copy, button labels, position, expiry and other options in config. Styling lives in the published view and stylesheet, so you can match your own design system. Keep custom CSS and JS selectors documented because markup can change between releases.
- How does cookie-notice remember a visitor's consent choice?
- It stores the visitor's accept or decline choice in a browser cookie, and the banner stays hidden when a valid preference is already present. You can read that cookie from JavaScript or from the request server-side to decide whether to load optional scripts. Configure the cookie name and expiry in the published config if you need to align with your own policy.
- Does cookie-notice work with Inertia, Livewire or SPA front ends?
- It works with any Laravel front end, but Inertia and SPA setups usually need the component mounted manually in the root template rather than a Blade layout. In Livewire apps, make sure the banner is not re-rendered inside a component that could reset its visibility state. Test the initial page load carefully because the package relies on a small client-side script.
- Does the package block analytics or marketing scripts until consent is given?
- No. cookie-notice captures and persists a visitor's preference, but it does not gate scripts, block tags, maintain audit logs or provide consent receipts. You must wire your own script gating to the stored preference if you need enforcement. Treat it as a consent notice component, not a full consent management platform.
- Why does the cookie banner briefly flash on page load?
- A brief flash can happen when preferences are already stored but the banner's initial render path does not hide it early enough. Version 10.2.2 includes a fix for this visibility issue. If you have published views or assets, confirm you are running the fixed versions rather than stale copies.
- Do I need to republish views or assets after updating to v10.2.2?
- Possibly. Published views and assets are copies, so apps that ran vendor:publish may not receive the flash fix automatically. Republish with the force option in a local branch, diff the banner DOM and class names, and check for changelog or upgrade notes before deploying. Any custom CSS or JS targeting the banner should be retested.
- How should I test the cookie consent banner in Laravel?
- Cover three states: first visit with no cookie, accepted, and declined. Assert the banner visibility, cookie name and expiry, and that your gated scripts load only when consent matches your policy. Include a regression check for the initial page load flash and for custom CSS or JS selectors after every package update.
- Is cookie-notice enough for GDPR and ePrivacy compliance?
- It helps you meet common GDPR and ePrivacy expectations by showing a customizable notice and remembering a choice, but it is not a compliance control on its own. Organisations with regional rule sets, IAB TCF, DSAR evidence or audit requirements need a full CMP and an internal privacy owner. Get legal sign-off on your category model and script gating before relying on any banner.