PHPackages                             origami/consent - 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. origami/consent

ActiveLibrary

origami/consent
===============

Helper interface for user consent in laravel projects

2.5.0(3mo ago)319.3kMITPHPPHP ^8.2

Since Apr 25Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/papertank/origami-consent)[ Packagist](https://packagist.org/packages/origami/consent)[ RSS](/packages/origami-consent/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (16)Used By (0)

Laravel Consent [![Build Status](https://camo.githubusercontent.com/b60348f8fac1f233ff221dc05d7a3347b6f08b28c3440830f3c48cd59236dfce/68747470733a2f2f7472617669732d63692e6f72672f706170657274616e6b2f6f726967616d692d636f6e73656e742e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/papertank/origami-consent)
==========================================================================================================================================================================================================================================================================================================================

[](#laravel-consent-)

About
-----

[](#about)

The `origami/consent` helper package contains a Laravel model trait to make saving, comparing and revoking consent easier. The package saves all updates to consent to the `consent` table and provides a `GivesConsent` trait for models like the User model.

The necessity for the package came about through GDPR and the [UK Information Commissioner's Office guidance on "Consent"](https://ico.org.uk/for-organisations/guide-to-the-general-data-protection-regulation-gdpr/lawful-basis-for-processing/consent/).

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

[](#installation)

This package is designed for Laravel &gt;= 10.0. You can pull in this package through composer.

```
composer require origami/consent

```

You should publish the consent table migration with:

```
php artisan vendor:publish --provider="Origami\Consent\ConsentServiceProvider" --tag="migrations"

```

The migrate the database:

```
php artisan migrate

```

Usage
-----

[](#usage)

To use the package, add the `GivesConsent` trait to a model you'd like to track consent for.

```
use Origami\Consent\GivesConsent;

class User extends Model {

  use GivesConsent;

}
```

### Give consent

[](#give-consent)

You can mark explicit consent given like this:

```
$model->giveConsentTo('consent-name');
```

GDPR requires you to keep a record of exactly what was shown at the time. You can do this in the `text` attribute, and pass anything extra in `meta`

```
$model->giveConsentTo('consent-name', [
  'text' => 'You are consenting to ...',
  'meta' => [
    'ip' => '192.168.0.1',
  ]
]);
```

### Give consent

[](#give-consent-1)

You can revoke a user's consent like so:

```
$model->revokeConsentTo('consent-name');
```

### Checking consent

[](#checking-consent)

You can check if consent is given like so:

```
if ( $model->hasGivenConsent('consent-name') ) {

}
```

If consent has not been set, the default is `false`. You can change that in the 2nd paramter.

```
if ( $model->hasGivenConsent('consent-name', true) ) {

}
```

### Current consent

[](#current-consent)

You can get the user's current consent status like so. This will be an instance of `Origami\Consent\Consent`

```
$consent = $model->getConsent('consent-name');
```

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

[](#contributing)

Please submit improvements and fixes :)

Author
------

[](#author)

[Papertank Limited](https://papertank.com)

License
-------

[](#license)

[View the license](https://github.com/papertank/origami-consent/blob/master/LICENSE)

###  Health Score

55

—

FairBetter than 98% of packages

Maintenance79

Regular maintenance activity

Popularity28

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity83

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 93.5% 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

Every ~202 days

Recently: every ~356 days

Total

15

Last Release

110d ago

Major Versions

0.4.0 → 1.0.02020-07-02

1.0.0 → 2.0.02020-09-13

PHP version history (6 changes)0.1.0PHP &gt;=5.6.4

1.0.0PHP ^7.1.3

2.0.0PHP ^7.2

2.1.0PHP ^7.2|^8.0

2.2.0PHP ^7.2|^8.0.2

2.5.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/0b1eb2c68ae9c43fc61ae8aa21aabaf932fcb1fd2372e77db8e7800d38cdf3d2?d=identicon)[papertank](/maintainers/papertank)

---

Top Contributors

[![davidrushton](https://avatars.githubusercontent.com/u/4039772?v=4)](https://github.com/davidrushton "davidrushton (29 commits)")[![dsbilling](https://avatars.githubusercontent.com/u/9788214?v=4)](https://github.com/dsbilling "dsbilling (2 commits)")

---

Tags

consentgdprlaravel-5-package

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/origami-consent/health.svg)

```
[![Health](https://phpackages.com/badges/origami-consent/health.svg)](https://phpackages.com/packages/origami-consent)
```

###  Alternatives

[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[watson/validating

Eloquent model validating trait.

9723.3M47](/packages/watson-validating)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

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