mike-zange / encryptable
Encryptable Trait for Laravel to make individual fields encrypted
Installs: 16
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 0
pkg:composer/mike-zange/encryptable
Requires
- php: >=7.0
- illuminate/encryption: ~5.6
This package is auto-updated.
Last update: 2025-09-29 02:02:34 UTC
README
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
-
As always: back up your database - I am not responsible for any data loss
-
Install the package via Composer:
composer require mike-zange/laravel-encryptable
-
On your model add:
use Encryptable; public $encryptable = [ 'field_1', 'field_2', 'field_3', 'field_4' ];
The trait will take care of the rest