netipar/laravel-consent
A Laravel package for managing user consent and privacy preferences. Track opt-ins and opt-outs, store consent records, and integrate GDPR-friendly consent flows into your application with simple, configurable APIs.
version, re-prompt on policy change — are encoded in the contract rather than reinvented per feature squad.google.tags, signals, ads_data_redaction, url_passthrough, deferred tag load, and consent update on later grants covers the common marketing-analytics ask without a separate vendor contract._ga_*-style prefixes) on host and parent domains, on every revoking transition and on stale versions, plus reload_on_revoke, lets you promise "revoking actually removes what we set" in a privacy policy.de, en, es, fr, hu) mean Blade, Alpine, and Vue render identical strings — useful when deciding whether to expand into new markets or ship a localized landing page.event_id idempotency, retention pruning, and Consent::history() supports DSR/audit answers — and lets you defer buying a record-keeping product.netipar/laravel-office-leads and the documented upgrade path from netipar/cookie-consent 1.x signal that consent is being treated as shared infrastructure — a portfolio-level decision, not a per-app one.Consider it when:
<script type="text/plain" data-consent="…">, including CSP nonce and module scripts.netipar/cookie-consent 1.x and want the documented path.Look elsewhere when:
Cookie header, which assumes the request reaches your app.For executives: This is a small, self-hosted Laravel package that satisfies the consent requirements we actually have — no non-essential script loads before a grant, a decision is invalidated when our cookie policy changes, users can withdraw and have cookies actively deleted, and Google Consent Mode v2 Basic is covered for marketing tags. It replaces an "evaluate and contract a CMP" line item with a bounded engineering task, and it removes the per-site vendor fee and the third-party JS dependency from the critical path. The trade-off is explicit: we own the compliance surface and the legal review, and we get no vendor indemnity, no IAB TCF support, and no geo-targeted prompting. At v0.1.0 we should treat the API as stabilising — pin the version and expect upgrades.
For engineering: The package is a config-driven consent core, not a framework. Server-side Consent facade (allows(), granted(), hasDecision(), decision(), clientConfig(), cookieTable()), Blade conditionals and @consentConfig, plus an unstyled <x-consent::banner> and <x-consent::cookie-table>. Client side is one framework-free core with thin Alpine (registerConsent(), consentBanner, Livewire-navigation aware) and Vue 3 (createConsentPlugin(), useConsent(), renderless ConsentBanner) adapters, all reading the same clientConfig() texts so we cannot drift between stacks. Consent state is a versioned cookie (__cookie_consent / __cookie_consent_v) validated against the config version, read from the raw Cookie header — so it works without session coupling and is compatible with netipar/laravel-office-leads.
Two integration points deserve early attention, because they are where the work actually lands: script gating converts existing tags to <script type="text/plain" data-consent="…"> (CSP nonce and module types supported), and withdrawal requires us to enumerate per-category cookie names and prefixes in config — that inventory is the real deliverable, and it is also what makes the deletion promise true on host and parent domains. Google tags are declarative (google.tags, google.signals, ads_data_redaction, url_passthrough) and load only after consent, with consent update and a late config on subsequent grants.
The optional log is opt-in: CONSENT_LOG_ENABLED, publishable migration, POST /consent/log behind web with throttling and event_id idempotency, HMAC-hashed truncated IP, retention-driven pruning, and Consent::history(). Enable it if we need an audit answer; skip it and we carry no PII surface. Documentation is bilingual (EN/HU) with a cookbook and an upgrade guide from netipar/cookie-consent 1.x, which materially lowers the cost of the first migration.
What we are accepting: pre-1.0 churn, Basic Consent Mode only (no TCF, no advanced/server-side GTM), unstyled UI that needs design and accessibility QA against the stated contract, and no regional prompting logic. If marketing later asks for TCF vendor lists or geo-targeted banners, that is a re-evaluation, not a config change.
How can I help you explore Laravel packages today?