Download the PHP package outsidaz/laravel-data-anonymization without Composer
On this page you can find all versions of the php package outsidaz/laravel-data-anonymization. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-data-anonymization
Laravel Data Anonymization
This Laravel package facilitates data anonymization, which helps organizations protect privacy, comply with regulations, reduce the risk of data breaches, and enable safe data sharing:
-
Protecting privacy: Data contains sensitive information about individuals, such as their name, address, email, phone number, and other personally identifiable information (PII). Data anonymization helps protect the privacy of individuals by removing or masking their PII from the dataset.
-
Compliance with regulations: Many countries and industries have regulations that require organizations to protect the privacy of individuals by anonymizing their data. For example, the General Data Protection Regulation (GDPR) in the European Union requires organizations to protect the privacy of individuals by anonymizing their data.
-
Reducing the risk of data breaches: Data breaches can have serious consequences for organizations and individuals, including financial loss, reputational damage, and identity theft. By anonymizing data, organizations can reduce the risk of data breaches and minimize the impact of any data breaches that do occur.
- Enabling data sharing: Anonymized data can be shared with other organizations or researchers without violating the privacy of individuals. This can help promote collaboration and innovation in fields such as healthcare, finance, and social sciences.
Installation
You can install the package via composer:
You can publish the config file with:
This is the contents of the published config file:
Usage
Model based definitions
In any model that contains sensitive data use the Anonymizable
trait and implement the anonymizableAttributes
method:
Factory based definitions
To reduce the amount of necessary code, the anonymizable attributes may also be defined on your factories.
Do note that the model still needs to implement the Anonymizable
to work with these definitions.
Attributes based on the factory's definition
It is possible to use the factory's definition to use as anonymizable values.
Implement the anonymizableAttributes
method on your factory and return an array with keys that corresponds to the definition of the factory:
This will use reduce the amount of code you need to write if the data you want to anonymize is the same as your factory's definition.
Note that only the defined keys will be anonymized!
Attributes based on a custom definition
If you prefer to still use custom values, you can still define them on the factory.
Implement the anonymizableDefinition
method on your factory, and return a keyed array:
Defining custom values is mostly useful when used in tandem with the anonymizableAttributes
method.
This allows certain attributes from the factory to be used, while still defining custom attributes when necessary:
Important note
The data from the
anonymizable
methods on the factory will overwrite the data defined in theanonymizableAttributes
method on the model!
Running the anonymizer
Anonymization is performed using command:
Or on specific models:
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-data-anonymization with dependencies
spatie/laravel-package-tools Version ^1.14.0
illuminate/support Version >=8.0
illuminate/contracts Version >=8.0
illuminate/console Version >=8.0