2017 © Pedro Peláez
 

library encryptable

Trait for use with Laravel 5 models allowing easy encryption/decryption of attributes.

image

chriswillerton/encryptable

Trait for use with Laravel 5 models allowing easy encryption/decryption of attributes.

  • Thursday, November 16, 2017
  • by ChrisWillerton
  • Repository
  • 1 Watchers
  • 2 Stars
  • 23 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 28 % Grown

The README.md

Encryptable

A trait for use with Laravel 5 models allowing easy encryption/decryption of attributes., (*1)

Installation

Add the following to the composer.json file in your project:, (*2)

"chriswillerton/encryptable": "1.*"

or you can run the below on the command line in the root of your project:, (*3)

composer require "chriswillerton/encryptable" "1.*"

Setup

To get started, add the trait to the model., (*4)

You also need to add an array detailing which attributes should be encrypted. Add this as a property on your model called $encryptedAttributes., (*5)

use ChrisWillerton\Encryptable\Encryptable;

class YourModel extends Eloquent
{
    use Encryptable;

    protected $encryptedAttributes = [
        'first_name',
        'surname',
        'email_address'
    ];

Notes

As this uses the encryption that ships with Laravel, please ensure you have set an app key before using this, otherwise your encrypted attributes will not be secure. Additionally, do not lose your app key, or you will not be able to decrypt your attributes., (*6)

Any issues decrypting attributes will be added to the Laravel log file, so if things aren't working as expected then check here first for details about the problem., (*7)

The Versions

16/11 2017

dev-master

9999999-dev

Trait for use with Laravel 5 models allowing easy encryption/decryption of attributes.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

by Chris Willerton

laravel model encryption

15/11 2017

1.0.0

1.0.0.0

Trait for use with Laravel 5 models allowing easy encryption/decryption of attributes.

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

by Chris Willerton

laravel model encryption