PHP Classes

Laravel LGPD: Manage the LGPD law terms and site user acceptance

Recommend this page to a friend!
  Info   View files Documentation   View files View files (18)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog (1)    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 45 This week: 1All time: 10,746 This week: 560Up
Version License PHP version Categories
lgpd 1.0.0MIT/X Consortium ...5PHP 5, Libraries, Business
Description 

Author

This package is specific mainly for applications used in Brazil Brazil .

This package can manage the LGPD law terms and site user acceptance.

It provides model classes that store the details of the LGPD law terms that a site implements and controller classes to process pages that will handle the management of those LGDP law terms.

The package also provides model and controller classes to manage the history of users that have site accounts and have accepted the implemented LGPD law terms of a site.

Em Português:

Este componente pode gerenciar os termos da lei LGPD e a aceitação do usuários de um site.

Ele fornece classes de modelo que armazenam os detalhes dos termos da lei LGPD que um site implementa e classes de controlador para processar páginas que tratarão do gerenciamento desses termos da lei LGDP.

O pacote também fornece classes de modelo e controlador para gerenciar o histórico de usuários que possuem contas no site e aceitaram os termos da lei LGPD implementados em um site.

Innovation Award
PHP Programming Innovation award nominee
August 2021
Number 3


Prize: One downloadable copy of CodeLobster Professional
LGPD is a law in Brazil that aims to protect people's rights to privacy when it comes to personal data.

The law is complex. Businesses and other institutions need to comply with a lot of requirements of the law.

People need to be presented with many terms to understand what happens with their personal data when they sign up for a service that needs to comply with the LGPD law.

Users need to state that they understand and agree with all services' terms to comply with the LGPD law.

This package provides a solution to manage all the terms of the LGPD law that the service implements, and each user agrees.

Manuel Lemos
Picture of Thiago Przyczynski
  Performance   Level  
Name: Thiago Przyczynski <contact>
Classes: 16 packages by
Country: Brazil Brazil
Age: 34
All time rank: 3203238 in Brazil Brazil
Week rank: 109 Up9 in Brazil Brazil Up
Innovation award
Innovation award
Nominee: 8x

Documentation

LGPD Laravel Package

LGPD support package for Laravel

Installation

` composer require thiagoprz/lgpd`

  • Add service provider (only if not using package auto discovery enabled) on config/app.php:
... 
'providers' => [
    ...
    \Thiagoprz\Lgpd\LgpdServiceProvider::class,
],
...

  • Migrate tables:

` php artisan migrate`

  • Add routes for terms implementation (api.php or web.php):

// LGPD CRUD resources (GET, POST, PATCH and DELETE already implemented)
Route::resource('lgpdterm', 'Thiagoprz\Lgpd\Http\Controllers\LgpdTermController');
Route::resource('lgpdtermitem', 'Thiagoprz\Lgpd\Http\Controllers\LgpdTermItemController');
Route::resource('lgpduseracceptance', 'Thiagoprz\Lgpd\Http\Controllers\LgpdUserAcceptanceController');

// LGPD Active Term
Route::get('lgpd/active', 'Thiagoprz\Lgpd\Http\Controllers\LgpdTermController@active');

  • Publish CRUD views to implement forms and management of the Terms and acceptance items.

` php artisan vendor:publish --provider="Thiagoprz\Lgpd\LgpdServiceProvider"`

Views will be stored in `resources/views/vendor/lgpd`.

Tables

  • lgpd_terms: LGPD terms

    | Column | Type | Description | Nullable | | ------ | --------- | ------------------- | --- | | id | bigint | ID (auto increment) | No | | term | text | Terms text | No | | publishing_date | datetime | Date and time when the version of the terms will become mandatory | No | | version | varchar | Version of the terms | Yes | | created_at | datetime | Date and time of creation | No | | updated_at | datetime | Date and time of last update | Yes |

  • lgpd_term_items: LGPD terms acceptance items

    | Column | Type | Description | Nullable | | ------ | --------- | ------------------- | --- | | id | bigint | ID (auto increment) | No | | lgpd_term_id | bigint | Term ID | No | | term | varchar(400) | Acceptance term text | No | | created_at | datetime | Date and time of creation | No | | updated_at | datetime | Date and time of last update | Yes |

  • lgpd_user_acceptance: Record of acceptance by the user

    | Column | Type | Description | Nullable | | ------ | --------- | ------------------- | --- | | id | bigint | ID (auto increment) | No | | lgpd_term_id | bigint | Term ID | No | | user_id | bigint | User ID | No | | created_at | datetime | Date and time of creation | No | | updated_at | datetime | Date and time of last update | Yes |

Goal

The goal of the project is to allow the creation of a text of terms and to contain one or more accepted ones containing the specificities of the terms presented. For example: in projects that have financial transactions it will often be necessary to indicate the terms of use of the tool itself plus the terms of use of the gateway or bank linked to the collection and payment process, these two terms can be presented together but ideally the system needs specify that the clauses of each have been accepted by the user.


Details

LGPD Laravel Package

Implementação da LGPD ligada ao cadastro de usuários do Laravel.

Instalação

` composer require thiagoprz/lgpd`

  • Adicionar o service provider (apenas se não tiver o package auto discover habilitado) no arquivo config/app.php:
... 
'providers' => [
    ...
    \Thiagoprz\Lgpd\LgpdServiceProvider::class,
],
...

  • Migrar as tabelas:

` php artisan migrate`

  • Adicionar as rotas para implementar os termos no seu projeto (api.php ou web.php):

// LGPD CRUD resources (GET, POST, PATCH e DELETE já implementados)
Route::resource('lgpdterm', 'Thiagoprz\Lgpd\Http\Controllers\LgpdTermController');
Route::resource('lgpdtermitem', 'Thiagoprz\Lgpd\Http\Controllers\LgpdTermItemController');
Route::resource('lgpduseracceptance', 'Thiagoprz\Lgpd\Http\Controllers\LgpdUserAcceptanceController');

  • Publicas as views para poder implementar os formulários e telas de gestão dos termos e aceites necessários.

` php artisan vendor:publish --provider="Thiagoprz\Lgpd\LgpdServiceProvider"`

As views estarão publicadas na pasta: `resources/views/vendor/lgpd`.

Tables

  • lgpd_terms: termos LGPD

    | Coluna | Tipo | Descrição | Nulo | | ------ | --------- | ------------------- | --- | | id | bigint | ID (auto incremento) | No | | term | text | Texto dos termos | No | | publishing_date | datetime | Data e hora em que os termos se tornarão obrigatórios | No | | version | varchar | Versão dos termos | Yes | | created_at | datetime | Data e hora da criação | No | | updated_at | datetime | Data e hora da última alteração | Yes |

  • lgpd_term_items: aceites dos termos LGPD

    | Coluna | Tipo | Descrição | Nulo | | ------ | --------- | ------------------- | --- | | id | bigint | ID (auto incremento) | No | | lgpd_term_id | bigint | ID do Termo | No | | term | varchar(400) | Texto do aceite de termos | No | | created_at | datetime | Data e hora da criação | No | | updated_at | datetime | Data e hora da última alteração | Yes |

  • lgpd_user_acceptance: Registros de aceite dos usuários

    | Coluna | Tipo | Descrição | Nulo | | ------ | --------- | ------------------- | --- | | id | bigint | ID (auto incremento) | No | | lgpd_term_id | bigint | ID do termo | No | | user_id | bigint | ID do usuário | No | | created_at | datetime | Data e hora da criação | No | | updated_at | datetime | Data e hora da última alteração | Yes |

Objetivo

O objetivo do projeto é permitir criar um texto de termos e nele conter um ou vários aceites contendo as especificidades dos termos apresentados. Por exemplo: em projetos que possuem transações financeiras muitas vezes será necessário indicar os termos de uso da própria ferramenta mais os termos de uso do gateway ou banco ligado ao processo de cobranças e pagamentos, estes dois termos podem ser apresentados juntos porém idealmente o sistema precisa especificar que as cláusulas de cada um foram aceitas pelo usuário.


  Files folder image Files  
File Role Description
Files folder imagedatabase (1 directory)
Files folder imageresources (1 directory)
Files folder imagesrc (1 file, 2 directories)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LEIAME.md Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  database  
File Role Description
Files folder imagemigrations (3 files)

  Files folder image Files  /  database  /  migrations  
File Role Description
  Plain text file 2021_03_23_132735_...gpd_terms_table.php Class Class source
  Plain text file 2021_03_23_133056_...erm_items_table.php Class Class source
  Plain text file 2021_03_23_140729_...cceptance_table.php Class Class source

  Files folder image Files  /  resources  
File Role Description
Files folder imageviews (1 directory)

  Files folder image Files  /  resources  /  views  
File Role Description
Files folder imagelgpdterm (5 files)

  Files folder image Files  /  resources  /  views  /  lgpdterm  
File Role Description
  Accessible without login Plain text file create.blade.php Aux. Auxiliary script
  Accessible without login Plain text file edit.blade.php Aux. Auxiliary script
  Accessible without login Plain text file form.blade.php Aux. Auxiliary script
  Accessible without login Plain text file index.blade.php Aux. Auxiliary script
  Accessible without login Plain text file show.blade.php Aux. Auxiliary script

  Files folder image Files  /  src  
File Role Description
Files folder imageHttp (1 directory)
Files folder imageModels (3 files)
  Plain text file LgpdServiceProvider.php Class Class source

  Files folder image Files  /  src  /  Http  
File Role Description
Files folder imageControllers (3 files)

  Files folder image Files  /  src  /  Http  /  Controllers  
File Role Description
  Plain text file LgpdTermController.php Class Class source
  Plain text file LgpdTermItemController.php Class Class source
  Plain text file LgpdUserAcceptanceController.php Class Class source

  Files folder image Files  /  src  /  Models  
File Role Description
  Plain text file LgpdTerm.php Class Class source
  Plain text file LgpdTermItem.php Class Class source
  Plain text file LgpdUserAcceptance.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:45
This week:1
All time:10,746
This week:560Up