Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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