quebecstudio-mods / consent-kit-register
Consent register shared by the Cookie Consent Kit CMS integrations: schema, storage and queries.
Package info
github.com/quebecstudio-mods/consent-kit-register
pkg:composer/quebecstudio-mods/consent-kit-register
Requires
- php: >=8.2
- illuminate/database: ^11.0 || ^12.0 || ^13.0
- illuminate/support: ^11.0 || ^12.0 || ^13.0
- quebecstudio-mods/consent-kit-core: ^1.2
Requires (Dev)
- larastan/larastan: ^3.0
- laravel/pint: ^1.32
- orchestra/testbench: ^9.0 || ^10.0 || ^11.0
- pestphp/pest: ^3.0 || ^4.0 || ^5.0
- pestphp/pest-plugin-laravel: ^3.0 || ^4.0 || ^5.0
- pestphp/pest-plugin-type-coverage: ^3.0
- phpstan/phpstan: ^2.2
- rector/rector: ^2.6
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-23 21:38:51 UTC
README
The consent register shared by the Cookie Consent Kit integrations that keep one: its schema, its storage and its queries.
| Integration | Package |
|---|---|
| Craft CMS 6 | quebecstudio-mods/craftcms-consent-kit 6.x |
| Statamic 6 | quebecstudio-mods/statamic-consent-kit 6.x |
Requires PHP 8.2, illuminate/database, illuminate/support and
quebecstudio-mods/consent-kit-core. It holds no panel and no HTTP layer: an
integration decides what to record and how to show it, this keeps it.
quebecstudio-mods/laravel-consent-kit does not use it — it renders the
banner and leaves the register to the application.
Contents
| Path | What it is |
|---|---|
src/Connection.php |
Which database the register is kept in |
src/Register.php |
Storage and queries: store, page, find, purge |
database/migrations/ |
The two tables, consent_decisions and consent_presentations |
Schema
consent_decisions holds one row per reported answer: the site, the language,
the user when the site records one, what was pressed, where from, the
categories granted and the resulting outcome.
consent_presentations holds one row per distinct banner screen, keyed by the
fingerprint Presentation computes in the core. Decisions point at it, so a
screen shown a million times is stored once, and a stored decision can be
replayed against the exact wording it answered.
Which database
Connection::name() resolves, in order:
cookie-consent.register.connection, when the site names one;- the site's own default connection, when it opens;
- a SQLite file in
storage/cookie-consent/register.sqlite, declared and migrated byConnection::migrate().
Using it
use QuebecStudioMods\ConsentKit\Register\Connection; use QuebecStudioMods\ConsentKit\Register\Register; $register = new Register(new Connection()); $register->store([ 'siteHandle' => 'default', 'userId' => null, 'language' => 'en', 'decidedAt' => '2026-09-23 14:02:11', 'action' => 'save', 'origin' => 'dialog', 'categories' => ['necessary', 'analytics'], 'outcome' => 'partial', 'consentVersion' => 3, 'presentationId' => $register->presentationId($presentation), ]);
Reading a page, either from plain filters or from a query the integration has already filtered:
['rows' => $rows, 'total' => $total] = $register->page(['site' => 'default'], page: 1, perPage: 50); $rows = $register->rows($register->query()->where('d.outcome', 'all'), 1, 50, 'decidedAt', 'desc');
Retention is the core's: Registry::cutoff() gives the date beyond which a
record has outlived what it attests, and $register->purge($cutoff) deletes
those rows, then the screens no decision points at any more.
Licence
Proprietary. See LICENSE.md.