jeffersongoncalves / laravel-lgpd-records
LGPD records of processing activities (ROPA) for Laravel: purposes, legal bases, recipients and international transfers, joined with the personal data inventory, plus the data protection officer's public contact.
Package info
github.com/jeffersongoncalves/laravel-lgpd-records
pkg:composer/jeffersongoncalves/laravel-lgpd-records
Requires
- php: ^8.2
- illuminate/console: ^12.0|^13.0
- illuminate/contracts: ^12.0|^13.0
- illuminate/database: ^12.0|^13.0
- illuminate/support: ^12.0|^13.0
- illuminate/view: ^12.0|^13.0
- jeffersongoncalves/laravel-lgpd: ^1.1
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- jeffersongoncalves/pest-plugin-database-migrations: ^1.0
- larastan/larastan: ^3.0
- laravel/pint: ^1.24
- orchestra/testbench: ^10.0|^11.0
- pestphp/pest: ^3.0|^4.0
- pestphp/pest-plugin-laravel: ^3.0|^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
The Brazilian General Data Protection Law (LGPD, Lei 13.709/2018) asks controllers to keep records of their processing operations (art. 37, the ROPA). It also asks them to publish the identity and contact of their data protection officer, the encarregado (art. 41). This package stores your processing activities and joins each one with the columns you declared in laravel-lgpd. Your records follow your code.
This package gives you tooling. It does not make you compliant on its own. Your records need legal review.
Installation
composer require jeffersongoncalves/laravel-lgpd-records
php artisan vendor:publish --tag="lgpd-records-migrations"
php artisan migrate
LGPD_CONTROLLER_NAME="Acme Ltda" LGPD_CONTROLLER_DOCUMENT="00.000.000/0001-00" LGPD_DPO_NAME="Ana Souza" LGPD_DPO_EMAIL=dpo@acme.com.br
Processing activities
use JeffersonGoncalves\Lgpd\Enums\LegalBasis; use JeffersonGoncalves\LgpdRecords\Models\ProcessingActivity; ProcessingActivity::create([ 'name' => 'Billing', 'purpose' => 'Issue invoices and collect payments', 'legal_basis' => LegalBasis::Contract, 'data_subjects' => ['customers'], 'models' => [Customer::class], // its #[PersonalData] columns join the record 'data_categories' => ['payment history'], // anything not declared on a model 'recipients' => [['name' => 'Stripe', 'role' => 'processor', 'country' => 'US']], 'international_transfers' => [['country' => 'US', 'mechanism' => 'standard_clauses']], 'retention' => '5 years after the end of the contract', 'security_measures' => 'Encryption at rest, role-based access, audit log', ]);
role:processor(operador),controller(shared controller) orpublic_authority.mechanism: the legal ground for the transfer (art. 33), such asadequacy,standard_clauses,binding_corporate_rulesorspecific_consent.
Export
php artisan lgpd:ropa # one row per activity php artisan lgpd:ropa --json # controller, DPO and every activity, ready to hand to the ANPD
LgpdRecords::export(); // the same, as an array
The command warns you when the DPO contact is missing.
Data protection officer
Publish the encarregado's identity and contact on your website (art. 41, §1):
<x-lgpd-records::dpo label="Encarregado" class="text-sm" />
It renders the name, a mailto: link and a tel: link, and renders nothing until a DPO is configured.
Privacy policy
Your privacy notice must tell data subjects, clearly, the purpose, legal basis, duration and recipients of each processing, plus their rights (arts. 9 and 18). The records already hold all of that, so render the notice from them:
{{-- resources/views/privacy.blade.php, inside your layout --}} <x-lgpd-records::privacy-policy rights-url="{{ route('privacy.requests') }}" class="prose" />
It renders the controller, the DPO, one section per processing activity, the art. 18 rights and the right to complain to the ANPD. Each activity lists its purpose, legal basis, data (its data_categories plus its declared columns, flagged when sensitive), data subjects, recipients, international transfers and retention. The last-updated date comes from the activities, so the notice changes when your records change. Without rights-url it points readers to the DPO.
Texts ship in English and Brazilian Portuguese and follow the app locale. Publish them (--tag="lgpd-records-translations") or the view (--tag="lgpd-records-views") to change the wording. The markup is plain semantic HTML with no styles, so your CSS (or prose) decides how it looks.
Generating the notice from the records keeps the two in sync. It still needs legal review, like the records themselves.
Testing
composer test
Changelog
See CHANGELOG.
License
The MIT License (MIT). See License File.
