jeffersongoncalves/laravel-privacy
Larablocks Analysis
jeffersongoncalves/laravel-privacy works with Laravel 12 and 13 (latest release 1.0.0, Nov 18, 2026).
Recommendation checks
Use with careUse with care: meets 2 of 5 checks.
- Works with Laravel 13, the current version
- Released in the last 12 months (Nov 18, 2026)
- First released under 90 days ago
- 1,458 downloads a month (needs 10,000)
- 1 GitHub star (needs 100)
State
Too new to judge- Last stable release: Nov 18, 2026.
- 1 release in the last 12 months.
- First released: Nov 18, 2026.
- Monthly downloads: 1,458.
- 0 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Dec 2, 2026.
| Install | |
|---|---|
composer require jeffersongoncalves/laravel-privacy |
|
| Latest Version: | 1.0.0 |
| PHP: | ^8.2 |
| Laravel: | 12 · 13 |
| License: | MIT |
| Last Updated: | Dec 1, 2026 |
| Links: | GitHub · Packagist |
Laravel Privacy

The engine shared by the privacy suites for Laravel. You don't install it on its own: install the suite of your law, which pulls it in.
| Suite | Law |
|---|---|
| laravel-lgpd | Brazil: LGPD (Lei 13.709/2018) |
| laravel-gdpr | EU: GDPR (Regulation (EU) 2016/679) |
| laravel-ccpa | California: CCPA/CPRA |
| laravel-us-privacy | The other US state privacy laws |
| laravel-quebec | Quebec: Law 25 |
What it holds
The parts that work the same under every law live here, tested once:
| Part | Classes |
|---|---|
| Personal data declarations | Attributes\PersonalDataAttribute, Contracts\HasPersonalData, Concerns\InteractsWithPersonalData, Contracts\AnonymizeStrategy + Concerns\AppliesAnonymizeStrategy |
| Inventory and k-anonymity | Privacy, Generalize, Commands\InventoryCommand, Commands\KAnonymityCommand |
| Retention | Retention\RetentionManager, Retention\Tombstone, Retention\Listeners\RecordTombstones, the retention commands |
| Audit log | AuditLog\AuditLogger, AuditLog\AuditLog, AuditLog\Concerns\AuditsPersonalData, AuditLog\Commands\VerifyCommand |
| Consent ledger | Consent\ConsentManager, Consent\ConsentRecord, Consent\Concerns\HasConsents, Consent\ConsentController |
What depends on the law stays in each suite: the #[PersonalData] attribute and its enums (data categories, legal
bases, flags such as sold or outsideQuebec), the requests and their deadlines, incidents, vendors, minors, notices.
Suites side by side
Each suite subclasses these classes and names its own config, tables, attribute and events. A model declared with
JeffersonGoncalves\Gdpr\Attributes\PersonalData is only seen by the GDPR suite, and its anonymization fires
JeffersonGoncalves\Gdpr\Events\PersonalDataAnonymized, which only the GDPR retention and audit log listen to. So
an app serving Brazil and Europe can install the LGPD and GDPR suites together.
Building a suite
A suite's classes are thin subclasses. The main class names its config file:
use JeffersonGoncalves\Privacy\Privacy;
class Gdpr extends Privacy
{
protected string $config = 'gdpr'; // gdpr.models, gdpr.hash_key
protected string $contract = HasPersonalData::class; // the suite's contract (extends the core one)
}
The attribute extends PersonalDataAttribute and fills column, retention and anonymize. Property types are
invariant, so it takes its AnonymizeStrategy enum as a plain parameter and assigns it:
#[Attribute(Attribute::TARGET_CLASS | Attribute::IS_REPEATABLE)]
final class PersonalData extends PersonalDataAttribute
{
public function __construct(
public string $column,
public DataCategory $category = DataCategory::Personal,
public ?string $retention = null,
AnonymizeStrategy $anonymize = AnonymizeStrategy::Nullify,
) {
$this->anonymize = $anonymize;
}
public function toArray(): array { /* the inventory row */ }
}
enum AnonymizeStrategy: string implements \JeffersonGoncalves\Privacy\Contracts\AnonymizeStrategy
{
use \JeffersonGoncalves\Privacy\Concerns\AppliesAnonymizeStrategy;
const HASH_KEY = 'gdpr.hash_key';
case Nullify = 'nullify';
case Hash = 'hash';
case Mask = 'mask';
case Keep = 'keep';
}
The traits name the suite's attribute, event, logger or manager through abstract static methods
(personalDataAttribute(), personalDataAnonymizedEvent(), auditLogger(), consentManager(),
consentRecordModel()), and the engine classes take their config key and models as properties
(RetentionManager::$config / $tombstone, AuditLogger::$config / $model, ConsentManager::$config / $model /
$event, ConsentRecord::$actionEnum). See any of the suites above for the full set.
Testing
composer test
Changelog
See CHANGELOG.
License
The MIT License (MIT). See License File.
Alternatives to jeffersongoncalves/laravel-privacy
A GDPR-compliant cookie consent solution for Laravel applications with fully cus...
Visual privacy layer for Filament — blur and mask sensitive data in tables, form...
Versioned legal consent for Laravel: contract acceptance, notice acknowledgment...
Universal change history and audit log for Laravel. Tracks who changed what and...
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 1.0.0 | ^8.2 | ^12.0| | MIT |