pushery/legal-consent-for-laravel

Court-proof, versioned legal consent for Laravel — GDPR-correct separation of contract acceptance, notice acknowledgment, and consent, with an append-only audit trail.
7,957 3
Install
composer require pushery/legal-consent-for-laravel
Latest Version:v0.43.0
PHP:^8.4
License:MIT
Last Updated:Sep 28, 2026
Links: GitHub  ·  Packagist
Maintainer: pushery

Legal Consent for Laravel

Latest Version PHP Version Laravel Versions License

Tests Coverage Type Coverage PHPStan Code Style Databases Mutation

Versioned legal consent for Laravel, recorded with the exact text each person accepted. It is a document-acceptance ledger: the package renders and proves your legal texts — it does not own them.

A registration does three legally distinct things — accepting a contract, taking notice of a privacy notice, and giving a real consent — and treating them as one "I accept everything" checkbox is a common, and real, GDPR violation. This package keeps them apart, and proves acceptance the way the law requires (Art. 7(1); EDPB 05/2020 §108): it stores the exact text a user was shown, its version and hash, and the server-side context — not just a timestamp.

Installation

composer require pushery/legal-consent-for-laravel

PHP 8.4+ · Laravel 13 · SQLite, PostgreSQL, and MySQL 8.4 LTS — every database-touching path is tested against a real PostgreSQL and a real MySQL, not just SQLite.

What it does

  • Append-only audit ledger — every acceptance, acknowledgment, and withdrawal is one immutable row with denormalized proof, hardened by a database trigger and an app-layer guard.
  • Versioned documents — a SHA-256 hash detects a change; you classify how it must be communicated; only a core contract change forces active re-consent.
  • Four notice modes — silent editorial, announced-but-never-blocking, deemed consent with an objection window (§ 308 Nr. 5 BGB), and a hard re-consent gate. The three that announce carry delivery proof; the silent one announces nothing, so there is nothing to prove.
  • Interchangeable content sources — Markdown files, or an admin-maintained draft store reviewed per locale before a publish freezes it.
  • Fortify-optional — three of the four ways to record consent replace Fortify's own flow: a trait, an event listener, or a headless JSON API. laravel/fortify is never required.
  • Optional, off by default — a tamper-evidence hash chain, an Art. 8 age gate, and multi-tenancy scoping, each a single config switch.
  • Optional reactive UI — plain Blade stubs by default; opt-in Livewire components and a WireKit-flavored variant, with no hard Livewire or Flux dependency.

Documentation

Full docs at docs.pushery.com/legal-consent-for-laravel.

  • Installation — requirements, the publish tags, and the two groups that stay separate because publishing them unasked would destroy data.
  • Quick start — write a text, publish a version, give a model a ledger, switch the gate on.
  • Recording consent — the four ways to write the ledger, the registration checklist, and the accept-time hash guard.
  • The four notice modes — how a change is classified, announced, and only sometimes enforced, with a worked example for each of the three that announce.
  • Configuration reference — every key, its default, and what it decides.
  • Testing your integration — Consent::fake(), so your tests need none of this package's tables.

Quality bar

Every change is held to Laravel Pint, Larastan at max, Rector, and a test suite at 100% line and type coverage, plus a real-browser end-to-end suite and cross-engine tests against a real PostgreSQL and MySQL 8.4, the engines it runs on in production, before it is released.

The suite is not part of the published package: the tests and their PHPUnit configuration stay in the development repository, so composer test has nothing to run from an installed copy. See CONTRIBUTING.md.

Security

Please review the security policy and report vulnerabilities privately rather than opening a public issue.

Built by Pushery

This package is built and maintained by Pushery — a Berlin-based studio building Laravel applications, SaaS products, and open-source tools.

Building a Laravel UI? WireKit, Pushery's open-source Livewire component kit, is the library this package's WireKit views are built with. Browse the rest of our work at pushery.com.

License

The MIT License (MIT). See LICENSE for details.

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

637,827,751 9,703
laravel/framework

The Laravel Framework.

589,172,971 34,950
laravel/tinker

Powerful REPL for the Laravel framework.

498,216,183 7,442
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

413,412,504 609
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

394,964,158 4,660

Version History

Version Released PHP Laravel License
v0.43.0 ^8.4 ^13.0 MIT
v0.42.4 ^8.4 ^13.0 MIT
v0.42.3 ^8.4 ^13.0 MIT
v0.42.2 ^8.4 ^13.0 MIT
v0.42.1 ^8.4 ^13.0 MIT