Skip to content

A simple encryptable trait for encrypting model fields in laravel

License

Notifications You must be signed in to change notification settings

mikezange/laravel-encryptable

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

  1. As always: back up your database - I am not responsible for any data loss

  2. Install the package via Composer:

    composer require mike-zange/laravel-encryptable

  3. On your model add:

    use Encryptable;
    
    public $encryptable = [
        'field_1',
        'field_2',
        'field_3',
        'field_4'
    ];
    

The trait will take care of the rest

About

A simple encryptable trait for encrypting model fields in laravel

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages