Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Consent For Laravel Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

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:

  • Non-Livewire application, unmodified views/assets: effectively a Composer bump plus view:clear. No new frontend dependency, no new build step, no DB/cookie migration, no consent reset. Low effort, low risk.
  • Application with published/customized head or banner views, or published assets: the release explicitly requires refreshing 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 application: additional work for livewire.enabled / livewire.navigation policy, @persist placement decisions, CSP/nonce alignment, and a measurement listener registered exactly once.

Technical risk.

  • Highest: asset/view version skew. The release states the three assets and the two views must move together; a partial deploy produces a UI whose runtime expectations no longer match the protected container. This is a silent-failure class of bug in a compliance surface.
  • High: CSP interaction. Livewire 4 requires its CSP-safe build when excluding 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.
  • Medium: measurement duplication. 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.
  • Medium: compliance sign-off. Czech and Dutch dictionaries are bundled (nine languages total), but translation content is a legal artifact. Regional fallbacks (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.
  • Low–medium: supply chain. A consent/audit surface maintained by a single package author is a bus-factor consideration; mitigation is pinning, changelog review, and retained ability to fork the published assets.
  • Quality signal: strong. Strict Composer validation, Pint, PHPStan level 8, 568 PHP tests / 3159 assertions, 281 JS tests. The caveat is that the package baseline skips two real-Livewire integration tests, with dependency-specific CI jobs covering them — so Livewire behavior is validated in the vendor's CI, not in the default suite.

Key questions.

  1. Which Livewire major (if any) is in use, and does our CSP exclude unsafe-eval?
  2. Have we published and then customized the head/banner views or the three assets, and can we diff them against the v1.5.0 originals?
  3. Do we operate multiple shared layouts (public, account, admin) each needing exactly one head and one banner?
  4. Do we need cs or nl for market coverage, and who signs off on translated consent text?
  5. How do we currently reconcile SPA pageviews with GA4 enhanced measurement, and who owns that listener?
  6. What is our evidence path for audit notices and withdrawal events, and does it survive Livewire history writes as claimed?

Integration Approach

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:

  1. Inventory before touching code. Record Livewire major version, CSP posture (nonce/hash strategy, unsafe-eval presence), whether views and assets are published/customized, active locales, audit settings, and any existing measurement listeners.
  2. Freeze consent configuration as change-controlled input. Policy version, presets, services, IDs, cookie scopes, colors, custom wording, audit settings must be preserved verbatim to keep saved preferences and their expiry valid. Diff config before and after.
  3. Upgrade in a branch. 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.
  4. CSP validation against the application's real policy — matching nonces to both consent components and Livewire; Livewire 4 CSP-safe build if excluding unsafe-eval.
  5. Locale decisions. Leave ui.locale=null and set the app locale before rendering; verify cs-CZ/nl-BE fallbacks and that custom dictionaries merge with expected precedence.
  6. Measurement wiring — register consent:navigated once, using the guarded helpers, and confirm no duplicate GA4 views.
  7. Documentation refresh via 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.

Operational Impact

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.

  • Mismatched assets vs. views → broken or unstyled banner; remediation is a re-deploy of the full unit.
  • Invalid script nonce → banner script blocked; package does not repair it and does not loosen CSP, so failure is quiet and compliance-relevant. Add synthetic monitoring that asserts the banner element exists and the container is populated.
  • Stale caches / unrestarted workers → old config or old compiled Blade served after upgrade.
  • Duplicate consent:navigated listeners → doubled analytics events; enforce single registration in code review.
  • Locale not set before render → English fallback in a non-English market; verify in Livewire update paths, not just initial load.
  • Withdrawal during SPA session → active withdrawal retains its required full reload and SPA visits cannot stop running tracker code; users may see a reload they did not expect. Document it so support doesn't treat it as a bug.

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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
andydefer/laravel-notification
adachsoft/cli-process-tester
jhaskell13/laraflow
sebastienheyd/boilerplate-media-manager
ccast/tagixo-primix
pretendtrue/laravel-builder
sawmainek/laravel-scout-tntsearch-driver
tomshaw/laravel-calendar-table
dibakar/laravel-ownership
steadrun/laravel-monitor
labyrinthe/connect-laravel
elmogy/layan
drewdan/sentinel-client
dskripchenko/laravel-llm
fatryst/nuonuo
stevenay/myanfont
gmostafa/php-graphql-client
xeviant/paystack
snowsoft/faker
meditationsteps/blogetc