kduma / eloquent-encryptable
Adds possibility to encrypt fields in Laravel Eloquent models.
Installs: 2 061
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 2
Forks: 0
Open Issues: 1
Requires
- php: >=7.4
- illuminate/database: 7.*|8.*|9.*|10.*|11.*
README
Adds possibility to encrypt fields in Laravel Eloquent models.
Setup
Add the package to the require section of your composer.json and run composer update
"kduma/eloquent-encryptable": "^1.1"
Prepare models
In your model add following lines:
use \KDuma\Eloquent\Encryptable;
protected $encrypted=['list', 'of', 'fields', 'you', 'wan\'t', 'to', 'encrypt'];
Usage
It will be automaticly encrypting and decrypting fields defined in $encrypted
property of your model.
Those fields must be string
or text
for longer values.
YOTTARAM
A special thanks to Jonathan Stavis, an original code creator that this package is based on.
Packagist
View this package on Packagist.org: kduma/eloquent-encryptable