PHPackages                             dystcz/laravel-cookie-consent-history - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dystcz/laravel-cookie-consent-history

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dystcz/laravel-cookie-consent-history
=====================================

This package allows you to simply store cookie consent history for users, so you can access it later in the unfortunate event of inspection or something.

v1.0.0(4y ago)320MITPHPPHP ^7.4|^8.0

Since Jan 27Pushed 4y ago1 watchersCompare

[ Source](https://github.com/dystcz/laravel-cookie-consent-history)[ Packagist](https://packagist.org/packages/dystcz/laravel-cookie-consent-history)[ Docs](https://github.com/dystcz/laravel-cookie-consent-history)[ RSS](/packages/dystcz-laravel-cookie-consent-history/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (6)Versions (2)Used By (0)

🍪 Laravel cookie consent history
================================

[](#-laravel-cookie-consent-history)

[![Latest Version on Packagist](https://camo.githubusercontent.com/1c1f3f93f9d91d57ce6db6e42a3e2d6e2f2763fcf75202628eb7676492f9fcc9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f64797374637a2f6c61726176656c2d636f6f6b69652d636f6e73656e742d686973746f72792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dystcz/laravel-cookie-consent-history)[![Total Downloads](https://camo.githubusercontent.com/edfe8dbae590bd6b3a16470030f8f04d6849953fc772573a10ef3268540e53b9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f64797374637a2f6c61726176656c2d636f6f6b69652d636f6e73656e742d686973746f72792e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/dystcz/laravel-cookie-consent-history)

This packages aims to make it easy to store anonymous cookie consents in a database in order to comply with rather strict EU cookie policy laws. Your application will get the power of keeping consent history, so you will have no problem with your burden of proof process when someone complains about your cookie consents.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require dystcz/laravel-cookie-consent-history
```

Publish config and migrations, run migrations

```
php artisan vendor:publish --provider="Dystcz\CookieConsentHistory\CookieConsentHistoryServiceProvider"
php artisan migrate
```

Register package routes in some of your route files, but if you want to use your own routes and controller, that is completely fine.

```
// routes/api.php

use Dystcz\CookieConsentHistory\CookieConsentHistoryFacade;

CookieConsentHistoryFacade::routes();
```

Configuration
-------------

[](#configuration)

```
return [
    /**
     * The prefix for the table names.
     * You can use your own prefix here, eg. company_ if it were to conflict with existing table names.
     * We leave it empty, so the table name is cookie_consents by default.
     */
    'table_prefix' => '',

    /**
     * The prefix for routes.
     * There are only 2 routes, one for storing the consent data and one for retrieving.
     *
     * POST /cookie-consents (or your prefix) saves the consent
     * GET /cookie-consents/{id} gets the consent if exists
     */
    'route_prefix' => 'cookie-consents',

    /**
     * Model definition.
     * You can extend the base model to your needs.
     */
    'model' => Dystcz\CookieConsentHistory\Models\CookieConsent::class,
];
```

Usage
-----

[](#usage)

### Storing consents

[](#storing-consents)

You can either register package routes, or you can introduce your own with your controller.

Below is an example store method which comes from `Dystcz\CookieConsentHistory\Http\Controllers\CookieConsentsController`.

```
/**
* Store cookie consent data.
*
* @param StoreCookieConsentRequest $request
*
* @return \Illuminate\Http\JsonResponse
*/
public function store(StoreCookieConsentRequest $request)
{
    // Create DTO out of validated request
    $data = new CookieConsentData(...$request->validated());

    $consent = CookieConsentHistory::save($data);

    return new JsonResponse([
        'data' => $consent,
    ]);
}
```

Complementary front end package
-------------------------------

[](#complementary-front-end-package)

We aim to also provide a complementary javascript package, that will work nicely with this package making cookie law compliance as easy as possible.

Stay tuned.

### Testing

[](#testing)

Tests coming soon!

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Jakub Theimer](https://github.com/dystcz)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1619d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/581117abe0f4b50c0ed62f6072f506571a3be5351311f447f10e120c24e2ddca?d=identicon)[theimerj](/maintainers/theimerj)

---

Top Contributors

[![repl6669](https://avatars.githubusercontent.com/u/5587309?v=4)](https://github.com/repl6669 "repl6669 (40 commits)")

---

Tags

dystczlaravel-cookie-consent-history

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/dystcz-laravel-cookie-consent-history/health.svg)

```
[![Health](https://phpackages.com/badges/dystcz-laravel-cookie-consent-history/health.svg)](https://phpackages.com/packages/dystcz-laravel-cookie-consent-history)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.4k](/packages/tomshaw-electricgrid)[reachweb/statamic-livewire-filters

Livewire filters for Statamic collections.

1713.2k](/packages/reachweb-statamic-livewire-filters)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
