{"id":41660973,"url":"https://github.com/papertank/origami-consent","last_synced_at":"2026-01-24T17:03:54.269Z","repository":{"id":31966062,"uuid":"131063893","full_name":"papertank/origami-consent","owner":"papertank","description":"Laravel model consent helper package (GDPR inspired)","archived":false,"fork":false,"pushed_at":"2025-03-10T14:13:40.000Z","size":21,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-05T16:36:53.135Z","etag":null,"topics":["consent","gdpr","laravel-5-package"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/papertank.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-04-25T21:08:03.000Z","updated_at":"2024-05-28T12:18:22.000Z","dependencies_parsed_at":"2024-06-01T14:10:48.214Z","dependency_job_id":null,"html_url":"https://github.com/papertank/origami-consent","commit_stats":{"total_commits":26,"total_committers":2,"mean_commits":13.0,"dds":0.07692307692307687,"last_synced_commit":"62a7fd44e67aa0a569b2b5f117413dfecaea645d"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/papertank/origami-consent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/papertank%2Forigami-consent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/papertank%2Forigami-consent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/papertank%2Forigami-consent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/papertank%2Forigami-consent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/papertank","download_url":"https://codeload.github.com/papertank/origami-consent/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/papertank%2Forigami-consent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28732218,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T10:24:43.181Z","status":"ssl_error","status_checked_at":"2026-01-24T10:24:36.112Z","response_time":89,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["consent","gdpr","laravel-5-package"],"created_at":"2026-01-24T17:03:53.708Z","updated_at":"2026-01-24T17:03:54.262Z","avatar_url":"https://github.com/papertank.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Laravel Consent [![Build Status](https://travis-ci.org/papertank/origami-consent.svg?branch=master)](https://travis-ci.org/papertank/origami-consent)\n\n## About\n\nThe `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.\n\nThe 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/).\n\n\n## Installation\n\nThis package is designed for Laravel \u003e= 10.0. You can pull in this package through composer.\n\n```\ncomposer require origami/consent\n```\n\nYou should publish the consent table migration with:\n\n```\nphp artisan vendor:publish --provider=\"Origami\\Consent\\ConsentServiceProvider\" --tag=\"migrations\"\n```\n\nThe migrate the database:\n\n```\nphp artisan migrate\n```\n\n## Usage\n\nTo use the package, add the `GivesConsent` trait to a model you'd like to track consent for.\n\n```php\n\nuse Origami\\Consent\\GivesConsent;\n\nclass User extends Model {\n\n  use GivesConsent;\n\n}\n\n```\n\n### Give consent\n\nYou can mark explicit consent given like this:\n\n```php\n$model-\u003egiveConsentTo('consent-name');\n```\n\nGDPR 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`\n\n```php\n$model-\u003egiveConsentTo('consent-name', [\n  'text' =\u003e 'You are consenting to ...',\n  'meta' =\u003e [\n    'ip' =\u003e '192.168.0.1',\n  ]\n]);\n```\n\n### Give consent\n\nYou can revoke a user's consent like so:\n\n```php\n$model-\u003erevokeConsentTo('consent-name');\n```\n\n### Checking consent\n\nYou can check if consent is given like so:\n\n```php\nif ( $model-\u003ehasGivenConsent('consent-name') ) {\n\n}\n```\n\nIf consent has not been set, the default is `false`. You can change that in the 2nd paramter.\n\n```php\nif ( $model-\u003ehasGivenConsent('consent-name', true) ) {\n\n}\n```\n\n### Current consent\n\nYou can get the user's current consent status like so. This will be an instance of `Origami\\Consent\\Consent`\n\n```php\n$consent = $model-\u003egetConsent('consent-name');\n```\n\n\n## Contributing\n\nPlease submit improvements and fixes :)\n\n## Author\n[Papertank Limited](https://papertank.com)\n\n## License\n[View the license](https://github.com/papertank/origami-consent/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpapertank%2Forigami-consent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpapertank%2Forigami-consent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpapertank%2Forigami-consent/lists"}