voodflow/vcookiebar
A lightweight, configurable cookie consent bar for Laravel applications. Show customizable notices, let visitors accept or reject cookies, and manage preferences with minimal setup.
composer require voodflow/voodbuilder-cookiebar. The package is pre-1.0 (0.2.x), so pin an explicit version in composer.json rather than using ^0.2.php artisan vendor:publish --provider="Voodflow\VoodbuilderCookiebar\CookiebarServiceProvider". Run php artisan vendor:publish with no arguments once to see the exact tags offered (config, views, translations, migrations) — the README is the source of truth for tag names, and they can differ between minor releases.config/cookiebar.php. This is where categories (typically necessary, analytics, marketing), cookie name/lifetime, banner text, and the accept/reject/settings behavior are defined. Get the category list right first; everything else (script gating, consent storage, UI) keys off it.web group in app/Http/Kernel.php (or bootstrap/app.php on Laravel 11+) if you want the bar injected automatically. The alternative is to include the Blade component manually in your layout just before </body> — pick one, not both.resources/views/layouts/app.blade.php, accept the defaults, then verify a cookie is written on click before customizing anything.cookiebar()->allows('analytics')) around analytics/marketing script tags in Blade. Client-side gating via data-cookiebar-category attributes is fine for convenience but should not be the only enforcement for anything privacy-relevant.consents table (user id or anonymous uuid, categories, version, IP hash, timestamp). Cookie-only consent is hard to defend in an audit.phpunit.xml (or via a cookiebar.enabled=false env) and drive the accept/reject flow with $this->withCookie(...) / $this->withUnencryptedCookie(...) to assert gated content appears. Asserting on the rendered banner itself is brittle; assert on the helper's return values.cookiebar.debug flag if available so you can see which category decisions were resolved without reading cookies by hand.0.2.7 shipped with an empty changelog (only a compare link). Review the diff on GitHub before upgrading from 0.2.6; with no documented changes you cannot assume it is a pure bugfix. Given the pre-1.0 version, treat any 0.x bump as potentially breaking.config/cookiebar.php, run php artisan config:clear (and config:cache in deploy). A stale cached config is the most common cause of "my category changes did nothing."necessary must always be on. Several cookie-bar packages let you accidentally toggle it off in config; if you do, the banner will re-prompt forever or, worse, block session/auth cookies. Guard that category in config and in your settings UI.StartSession and after any response-caching middleware. Putting it before a cache layer means the banner gets cached into responses for users who already consented, or cached out for users who haven't.SameSite, Secure, and HttpOnly settings in config. HttpOnly is usually wrong here if you need JS to read consent for client-side gating; Secure should be on in production. Cookie name changes silently invalidate existing consents — version the name.vendor/ overrides instead, your customizations disappear on composer update with no warning.cookiebar.enabled true for the env, (3) is config cached, (4) is the consent cookie present and correctly named, (5) does the helper see the same category keys you configured, (6) is a response cache serving stale HTML.0.2.x those are the most likely to move.How can I help you explore Laravel packages today?