Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikezange/laravel-encryptable
A simple encryptable trait for encrypting model fields in laravel
https://github.com/mikezange/laravel-encryptable
data encrypt field gdpr laravel model trait
Last synced: about 2 months ago
JSON representation
A simple encryptable trait for encrypting model fields in laravel
- Host: GitHub
- URL: https://github.com/mikezange/laravel-encryptable
- Owner: mikezange
- License: mit
- Created: 2018-08-01T11:49:26.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-08-22T14:47:59.000Z (over 6 years ago)
- Last Synced: 2024-05-28T20:46:21.113Z (7 months ago)
- Topics: data, encrypt, field, gdpr, laravel, model, trait
- Language: PHP
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Description
Reusable trait for encrypting Laravel model fields.## Requirements
- Any fields that are encryptable need to be changed to type "text" in the database, due to the encrypted data string being much longer than the original data.
- `PHP >=7.0`
- `Laravel ~5.6`## Installation
0. As always: back up your database - I am not responsible for any data loss
1. Install the package via Composer:
`composer require mike-zange/laravel-encryptable`
2. On your model add:
```
use Encryptable;
public $encryptable = [
'field_1',
'field_2',
'field_3',
'field_4'
];
```The trait will take care of the rest