VoodCookiebar
CommunityCookie consent for Laravel + Filament 5: opt-in preferences UI, real script gating, and a Filament settings page. Works standalone in any Filament app
filament/
namespace. Review the source and install at your own risk. Found
malware or an unresolved security issue the author won't
address?
Report it
.
Author:
Voodflow
Documentation
- Features
- Requirements
- Install
- Activate on the public site
- Configure (Filament)
- Gate scripts and cookies (required for real compliance)
- Standalone Laravel / Filament (no page builder)
- Optional: VoodBuilder
- Config highlights
- Security notes
- Testing
- License
- Changelog
Cookie consent for Laravel + Filament 5: opt-in preferences UI, real script gating, and a Filament settings page. Works standalone in any Filament app — no page builder required.
MIT licensed. Free to use, modify, and ship.
#Features
- Automatic integration — banner auto-injects into known public layouts, or include
<x-vcookiebar::banner />yourself - Settings page — enablement, categories, appearance, and per-locale banner texts + policy links from Filament
- GDPR-oriented consent — accept all / reject optional / customize; necessary always on; optional categories never pre-ticked
- Real blocking — scripts stay inert until the visitor grants the matching category; known analytics/marketing cookies are cleared when a category is declined; the page reloads after consent so revoked scripts unload
- Themes — Base (built-in light/dark), VoodBuilder (page palette, only if the builder is installed), Custom (color pickers)
- Highly configurable — placement, reopen control, cookie name, cleanup patterns
- Responsive — corner or full-width layouts; works on desktop and mobile
- Multi-language — packaged EN / IT / DE / ES / FR; Filament uses a primary configuration plus derived translations (Translate action), following site locales
#Requirements
| Requirement | Notes |
|---|---|
| PHP | 8.4+ |
| Laravel | 12 or 13 |
| Filament | 5 |
#Install
composer require voodflow/vcookiebar
php artisan vendor:publish --tag=vcookiebar-config
Register the plugin on your Filament panel:
use Voodflow\Vcookiebar\VcookiebarPlugin;
$panel->plugins([
VcookiebarPlugin::make(),
]);
Omitting VcookiebarPlugin hides the admin pages. Public consent routes still load while vcookiebar.enabled is true.
Optional: publish translations to customize packaged strings outside Filament:
php artisan vendor:publish --tag=vcookiebar-translations
#Activate on the public site
#Auto-inject (default)
With vcookiebar.auto_inject = true (default), the package pushes the banner onto the overlays stack of configured views (vcookiebar.auto_inject_views). Out of the box those entries target common VoodBuilder layouts; if those views are not present, nothing breaks — simply include the banner manually.
#Manual include (any Laravel layout)
{{-- typically near the end of <body> --}}
<x-vcookiebar::banner />
Set VCOOKIEBAR_AUTO_INJECT=false when you always include the component yourself.
#Configure (Filament)
Open Vcookiebar → Settings:
| Tab | What you set |
|---|---|
| General | Master enable, consent cookie name, placement / theme / colors, reopen icon, which categories appear under Customize |
| Banner texts | Primary copy + policy links per language, then Translate to derive other site languages. Blank text fields keep the packaged translation. Site-page policy targets still follow the visitor locale |
Visitor flow:
- First visit shows the banner (no consent cookie yet).
- Accept all / reject optional / customize →
POST /vcookiebar/consent(CSRF + throttle). - Preferences are stored in a first-party HttpOnly cookie; the page reloads.
- Gated scripts for granted categories activate; declined categories clear configured cookie names.
- Reopen control (if enabled) lets visitors change preferences later.
#Gate scripts and cookies (required for real compliance)
The banner alone does not invent tracking. You must not load non-essential scripts until consent. Mark them so the runtime can unlock them:
<script type="text/plain" data-vcookiebar="analytics" src="https://www.googletagmanager.com/gtag/js?id=G-XXXX"></script>
<script type="text/plain" data-vcookiebar="marketing">
// inline marketing pixel
</script>
Or wrap markup:
<x-vcookiebar::gated category="analytics">
<script src="https://www.googletagmanager.com/gtag/js?id=G-XXXX"></script>
</x-vcookiebar::gated>
Listen without coupling to Filament:
window.addEventListener('vcookiebar:consent', (event) => {
if (event.detail?.preferences?.analytics) {
// load analytics if you prefer an event-driven approach
}
});
window.__vcookiebar.has('analytics'); // boolean
window.__vcookiebar.open(); // reopen the dialog
Categories: necessary (always on), preferences, analytics, marketing.
Cookie cleanup patterns live under vcookiebar.cleanup_cookies (client-readable cookies only; HttpOnly cookies cannot be cleared from JavaScript). Extend the lists for your vendors.
#Standalone Laravel / Filament (no page builder)
composer require+ registerVcookiebarPlugin- Publish config; set policy URLs or configure them in Filament
- Add
<x-vcookiebar::banner />to your public layout (or pointauto_inject_viewsat your layout name) - Gate every analytics / marketing / preference script as above
That is the complete integration. The package does not depend on VoodBuilder, Voodflow, or any other companion.
#Optional: VoodBuilder
If you also use VoodBuilder, analytics scripts configured in the builder settings wait for analytics consent automatically, policy link fields can pick site pages / menu items, and the VoodBuilder color theme inherits the page palette. Without VoodBuilder installed, none of that is required — Vcookiebar stays fully usable on its own (Base or Custom themes).
#Config highlights
Publish config/vcookiebar.php. Useful keys / env:
| Key / env | Purpose |
|---|---|
enabled / VCOOKIEBAR_ENABLED |
Master switch |
route_prefix / VCOOKIEBAR_ROUTE_PREFIX |
Consent route prefix (vcookiebar) |
consent_cookie / VCOOKIEBAR_CONSENT_COOKIE |
Preference cookie name |
consent_lifetime_minutes |
Consent cookie lifetime (default ~1 year) |
auto_inject / VCOOKIEBAR_AUTO_INJECT |
Push banner into configured views |
auto_inject_views |
View names that receive the banner |
cleanup_cookies |
Names / prefixes to expire when a category is off |
content_locales |
Optional explicit locale list. Leave null to discover from the host (app.locales → cosmolab.locales → APP_LOCALES → app.locale) |
site_locales / APP_LOCALES |
Optional comma-separated locales from .env when app.locales is empty |
appearance.theme |
base | voodbuilder | custom (legacy: auto→base, voodflow→voodbuilder) |
appearance.* |
Placement, colors, reopen icon |
Admin choices are layered over config via a cache-backed settings store (no extra database table).
#Security notes
- Consent endpoint:
webmiddleware (CSRF) + throttle - Only configured category keys accepted;
necessaryforcedtrueserver-side - Consent cookie: HttpOnly, SameSite=Lax, Secure on HTTPS
- Do not store PII in the consent cookie
See SECURITY.md to report vulnerabilities.
#Testing
composer test
# or
./vendor/bin/phpunit
#License
MIT — see LICENSE. Trademark note: NOTICE.
#Changelog
See CHANGELOG.md.
The author
We are a development team focused on building modern, efficient management applications using FilamentPHP. We’ve been working with FilamentPHP since version 3 for several years, leveraging its flexibility to create solid, scalable, and productivity-oriented admin interfaces.
Over time, we developed an internal management system for one of our businesses, tackling real-world challenges and delivering practical, field-tested solutions. From that experience, we also built a range of plugins designed to extend Filament’s capabilities in a focused and meaningful way.
This natural evolution led to the creation of Voodflow: not just a plugin, but a full workflow engine that lives inside FilamentPHP. Voodflow is designed to orchestrate complex processes in an intuitive way, while preserving the consistency and elegance of the Filament ecosystem—while pushing it beyond its traditional limits.
From the same author
Vpress
Free & Open Source (MIT) — VitePress-style public frontend for Laravel with a Filament 5 admin panel.
Author:
Voodflow
Vdocs
Filament 5 package for documentation sites: markdown pages, VitePress-style sidebar navigation, import 1:1 from vite-press, table of contents, locales, and optional integration with voodflow/vpress.
Author:
Voodflow
Voodflow
Self-hosted visual workflow automation for Filament and Laravel: design and run automations in your own admin while your workflows, credentials, and data stay entirely on your infrastructure.
Author:
Voodflow
Vtuts
Filament 5 package for technical tutorials: markdown, table of contents, materials, tools, resources, SEO, translations, comments, learning paths (series), and optional public routes.
Author:
Voodflow
Featured Plugins
A selection of plugins curated by the Filament team
Noir Theme
A theme that gives panels a focused, refined look with near-black surfaces, crisp actions, and restrained color.
Filament
Custom Dashboards
Let your users build and share their own dashboards with a drag-and-drop interface. Define your data sources in PHP and let them do the rest.
Filament
Advanced Tables (formerly Filter Sets)
Supercharge your tables with powerful features like user-customizable views, quick filters, multi-column sorting, advanced table searching, convenient view management, and more. Compatible with Resource Panel Tables, Relation Managers, Table Widgets, and Table Builder!
Kenneth Sese