Skip to content
A simple encryptable trait for Laravel
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Check for empty field Mar 6, 2018
.gitattributes :octocat: Added .gitattributes & .gitignore files Oct 20, 2016
.gitignore :octocat: Added .gitattributes & .gitignore files Oct 20, 2016
README.md Initial Commit Oct 20, 2016
composer.json Initial Commit Oct 20, 2016

README.md

Encryptable, an ecryptable trait for Laravel

Encryptable is a trait for Laravel that adds simple encryptable functions to Eloquent Models.

Encryptable allows you to encrypt data as in enters the database and decrypts it on its retrieval.

Installation

Simple add the package to your composer.json file and run composer update.

"gregoryduckworth/encryptable": "1.*",

Usage

Add the trait to your model and your encryptable rules.

use GregoryDuckworth\Encryptable\EncryptableTrait;

class User extends Authenticatable
{
	use EncryptableTrait;

	/**
	 * Encryptable Rules
	 *
	 * @var array
	 */
	protected $encryptable = [
		'name',
		'email',
	];
	
...
}

Now, whenever you interact with the model, the name and email will automatically be encrypted and decrypted between your frontend and the database.

Contributing

Anyone is welcome to contribute. Fork, make your changes and then submit a pull request.

You can’t perform that action at this time.