PHPackages                             aichadigital/lara-privacy-core - 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. [PSR &amp; Standards](/categories/psr-standards)
4. /
5. aichadigital/lara-privacy-core

ActiveLibrary[PSR &amp; Standards](/categories/psr-standards)

aichadigital/lara-privacy-core
==============================

Dependency-free GDPR core for lara-privacy: the LegallyRetainable contract and a pure legal-hold decision (no Eloquent, no side effects, no jurisdiction).

v1.0.0(1mo ago)01.9k↓32%1MITPHP ^8.3

Since Jun 21Compare

[ Source](https://github.com/AichaDigital/lara-privacy-core)[ Packagist](https://packagist.org/packages/aichadigital/lara-privacy-core)[ RSS](/packages/aichadigital-lara-privacy-core/feed)WikiDiscussions Synced 2w ago

READMEChangelogDependencies (3)Versions (2)Used By (1)

lara-privacy-core
=================

[](#lara-privacy-core)

[![Latest Version](https://camo.githubusercontent.com/c411da3615020d3b2b80cb49915eb5836ba5f99ccdf38713703af563a440ace9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f61696368616469676974616c2f6c6172612d707269766163792d636f72652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aichadigital/lara-privacy-core)[![Total Downloads](https://camo.githubusercontent.com/684f9deb2ce21171fa8c440f0e2d71bcb36df9d03ca25229a36331abdff8b410/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f61696368616469676974616c2f6c6172612d707269766163792d636f72652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aichadigital/lara-privacy-core)[![Pipeline](https://camo.githubusercontent.com/9cd0cb93825cb51de713d8d093d161ad59c39336b7cf58a8f2d8286879cd745d/68747470733a2f2f6769746c61622e636173747269732e636f6d2f61696368616469676974616c2f6c6172612d707269766163792d636f72652f6261646765732f6d61696e2f706970656c696e652e7376673f7374796c653d666c61742d737175617265)](https://gitlab.castris.com/aichadigital/lara-privacy-core/-/pipelines)[![PHPStan level 9](https://camo.githubusercontent.com/b82d3e8b0863c1477c685e51b95a1200810a35a5ed56e0a6422398f56a4a80ae/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230392d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265266c6f676f3d706870)](https://phpstan.org/)[![PHP Version](https://camo.githubusercontent.com/7f1abeb713890fad243dd42f55e311ec14ebf518cb9e64ccd222564f97df1e03/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f61696368616469676974616c2f6c6172612d707269766163792d636f72652e7376673f7374796c653d666c61742d737175617265266c6f676f3d706870)](https://packagist.org/packages/aichadigital/lara-privacy-core)[![License](https://camo.githubusercontent.com/755ed609c90fe1789026c6703fc8c3a0fb06529a5bd14107752e79c579cccce2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f61696368616469676974616c2f6c6172612d707269766163792d636f72652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aichadigital/lara-privacy-core)

> Development happens on [gitlab.castris.com](https://gitlab.castris.com/aichadigital/lara-privacy-core). The GitHub repository is a read-only distribution mirror: issues and pull requests opened there are not seen.

The dependency-free, framework-free core of [`lara-privacy`](https://github.com/AichaDigital/lara-privacy): a universal contract for legal data-retention obligations and a pure decision over it.

No Eloquent, no side effects, no jurisdiction, no domain assumptions. A domain package (billing, medical, HR…) implements the contract; the privacy layer reads it to decide whether a record may be touched.

> **Governing rule:** lara-privacy defines privacy contracts. Domain packages implement them. No domain package — and no jurisdiction — defines the shape of the core.

Install
-------

[](#install)

```
composer require aichadigital/lara-privacy-core
```

Requires PHP 8.3+. That is the only requirement — there are no runtime dependencies.

What it ships
-------------

[](#what-it-ships)

- **`Contracts\LegallyRetainable`** — one method, `retainedUntil(): ?DateTimeInterface`: the instant until which an object must be kept, or `null` when it carries no retention obligation.
- **`CheckLegalHold`** — a pure, clock-injected decision: is a subject under an active retention hold at a given `$now`? (`retainedUntil > now`).

Quick example
-------------

[](#quick-example)

```
use AichaDigital\LaraPrivacyCore\Contracts\LegallyRetainable;
use AichaDigital\LaraPrivacyCore\CheckLegalHold;
use DateTimeImmutable;
use DateTimeInterface;

final class AccountingDocument implements LegallyRetainable
{
    public function __construct(
        private readonly ?DateTimeImmutable $fiscalYearEnd, // null = not booked
        private readonly int $years,
    ) {}

    public function retainedUntil(): ?DateTimeInterface
    {
        return $this->fiscalYearEnd?->modify("+{$this->years} years");
    }
}

$held = (new CheckLegalHold)->isUnderRetention($document, new DateTimeImmutable);
```

Documentation
-------------

[](#documentation)

- [Implementing `LegallyRetainable`](docs/implementing-legally-retainable.md) — the contract, three neutral domain examples, and what does *not* belong in it.

The Laravel integration (the read-only hold gate, jurisdictional retention presets, and worked adapters) lives in the [`aichadigital/lara-privacy`](https://github.com/AichaDigital/lara-privacy)package.

License
-------

[](#license)

MIT. See [LICENSE](LICENSE).

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance90

Actively maintained with recent releases

Popularity22

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

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

46d ago

### Community

Maintainers

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

---

Tags

contractsgdprprivacydata protectionrgpdretention

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/aichadigital-lara-privacy-core/health.svg)

```
[![Health](https://phpackages.com/badges/aichadigital-lara-privacy-core/health.svg)](https://phpackages.com/packages/aichadigital-lara-privacy-core)
```

###  Alternatives

[symfony/translation-contracts

Generic abstractions related to translation

2.6k765.3M737](/packages/symfony-translation-contracts)[symfony/cache-contracts

Generic abstractions related to caching

2.4k341.3M343](/packages/symfony-cache-contracts)[symfony/http-client-contracts

Generic abstractions related to HTTP clients

2.0k437.3M482](/packages/symfony-http-client-contracts)[symfony/contracts

A set of abstractions extracted out of the Symfony components

3.9k66.4M143](/packages/symfony-contracts)[facade/ignition-contracts

Solution contracts for Ignition

636151.1M166](/packages/facade-ignition-contracts)[opengento/module-gdpr

Gdpr Compliance Module for Magento 2

14587.4k](/packages/opengento-module-gdpr)

PHPackages © 2026

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