jakub-lipinski/consent-for-laravel
Consent for Laravel is a package for managing user consent records in Laravel apps. It helps implement GDPR-style flows where users grant or revoke permissions, then lets your application check and audit those choices throughout models, requests, and views.
Architecture fit. jakub-lipinski/consent-for-laravel is a self-contained consent management layer for Laravel: banner/dialog UI, category/preset/service definitions, policy versioning, cookie scoping, signed audit notices, and translation dictionaries. It ships as a Blade-component-driven package with a browser API (consent.js / banner.js) and no persistence-layer coupling beyond saved preferences and their original expiry. That makes it a low-blast-radius fit for a standard Laravel 12–13 / PHP 8.3+ application: it decorates layouts rather than owning routes, models, or middleware. v1.5.0 adds an optional Livewire adapter and two locales without altering the core model, so the architectural footprint is essentially unchanged for non-Livewire apps.
Integration feasibility. Upgrade cost is bimodal and must be estimated per application, not per package:
view:clear. No new frontend dependency, no new build step, no DB/cookie migration, no consent reset. Low effort, low risk.consent.js, banner.js, and consent.css together with the customized head/banner views, preserving the runtime-context marker, navigation attributes, data-consent-container, audit notice, wire:ignore, presentation key, and locale/context attributes. This is a coordinated multi-file change with internal invariants that are not compiler-enforced — a manual, review-heavy task.livewire.enabled / livewire.navigation policy, @persist placement decisions, CSP/nonce alignment, and a measurement listener registered exactly once.Technical risk.
unsafe-eval; nonce-bearing Livewire 3 degrades to full visits in auto mode; Livewire's DOMParser can require exact static-style hashes in addition to nonces. Critically, the package does not loosen CSP and does not repair explicitly invalid script nonces — meaning a misconfiguration can block banner script execution rather than error loudly. That is a legal-exposure-shaped failure with weak observability.consent:navigated fires once per compatible page swap, but the package sends no automatic SPA measurements; the application must register a single guarded listener and reconcile with GA4 enhanced history measurement. Double-counted or dropped pageviews are an analytics-integrity risk owned by the adopting team.cs-CZ, nl-BE) and the changed partial-dictionary inheritance rule (application-owned Dutch entries now inherit remaining Dutch package messages before English) mean custom wording must be re-reviewed.Key questions.
unsafe-eval?cs or nl for market coverage, and who signs off on translated consent text?Stack fit. The package aligns with existing Laravel conventions: Blade components, published config, artisan cache commands, vendor-published assets. The Livewire adapter is opt-in and auto-detected, so it does not force a Livewire dependency into non-Livewire projects — a meaningful constraint-respecting decision. Backward-compatible top-level defaults (livewire.enabled=true, livewire.navigation=auto) mean older published configs inherit sane behavior without editing.
Migration path. Treat v1.5.0 as a coordinated release-unit upgrade, not a Composer bump:
unsafe-eval presence), whether views and assets are published/customized, active locales, audit settings, and any existing measurement listeners.composer require "jakub-lipinski/consent-for-laravel:^1.5.0", then refresh the three assets and the customized head/banner views in the same commit, preserving the documented invariants.unsafe-eval.ui.locale=null and set the app locale before rendering; verify cs-CZ/nl-BE fallbacks and that custom dictionaries merge with expected precedence.consent:navigated once, using the guarded helpers, and confirm no duplicate GA4 views.php artisan boost:update, preserving application overrides.Compatibility. No database migration, no cookie migration, no automatic consent reset — the single largest de-risking property of this release. Existing Blade components and the browser API are retained. Livewire baselines are pinned (3.8.10+ / 4.4.7+); anything older should be treated as unsupported and pinned to ^1.4, which is a legitimate TPM decision if a Livewire upgrade is out of band.
Sequencing. Non-production first, then a canary on the highest-traffic layout. Deploy order matters: build/deploy code and refreshed assets together, invalidate stale page HTML, cache-bust external assets, clear compiled Blade/Livewire/config/route caches, and restart long-running workers so cached config doesn't hold the old schema. Never deploy assets ahead of views or vice versa. Rough sizing: 0.5–1 day for a non-Livewire, unmodified installation; 3–5 days for a Livewire SPA with customized views, CSP constraints, and analytics reconciliation — including legal review time separately.
Maintenance. Steady-state cost is low: no migrations, no scheduled jobs, no external service. The recurring work is (a) re-reviewing bundled translations and custom-dictionary merge behavior on each release, (b) keeping configuration under change control because saved-choice fingerprints and expiry derive from it, and (c) tracking the vendor's release cadence on a dependency that carries legal weight. Budget a standing line item for consent-config review per release, not per quarter.
Support. Support load concentrates in three places: CSP/nonce breakage in production, "banner didn't appear" tickets caused by stale compiled views or mismatched asset revisions, and analytics-team questions about missing or doubled pageviews. Publish a short internal runbook covering cache-clearing order, worker restart, and asset cache-busting, plus a triage decision tree that starts with "does the banner render at all?" before "is consent logic wrong?".
Scaling. Consent evaluation is browser-side and per-request; there is no server-side hotspot introduced by this release. The scaling concerns are operational rather than computational: shared layouts must each carry exactly one head and one banner (duplicate registration on a page composing multiple layouts is a plausible self-inflicted failure), and @persist usage must keep the complete UI and notice outside Livewire components. SPA navigation adds a per-swap script pause/resume path — verify behavior on long pages with many gated blocks, since the release notes state detached blocks cannot start their remaining scripts and new activations pause during swaps.
Failure modes.
consent:navigated listeners → doubled analytics events; enforce single registration in code review.Ramp-up. For a team already running the package, ramp-up is roughly a half-day of reading for the Livewire guide, interface guide, and upgrade sequence — the bundled Boost skill (thirteen focused references, including a dedicated Livewire reference) materially shortens this and should be refreshed with boost:update rather than hand-maintained. For a team adopting the package fresh, plan one engineer-day to absorb configuration semantics (presets, services, policy version, cookie scopes, audit settings) plus a legal review cycle; the skill references reduce, but do not remove, the need to understand how policy version and configuration changes interact with saved preferences and their original expiry.
How can I help you explore Laravel packages today?