New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

gregoryduckworth/encryptable

A simple trait to make attributes encrypted in the database
55,013 19
Install
composer require gregoryduckworth/encryptable
Latest Version:1.0.2
PHP:>=5.4.0
License:MIT
Last Updated:Feb 14, 2020
Links: GitHub  ·  Packagist
Maintainer: gregoryduckworth

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.

Related Packages

weebly/laravel-mutate

Mutate Laravel attributes

59,052 13
yadakhov/insert-on-duplicate-key

A trait for MySQL INSERT ON DUPLICATE KEY UPDATE.

3,123,272 275
audunru/eager-load-pivot-relations

Eager load pivot relations for Laravel Eloquent's BelongsToMany relation.

76,692 9
koodoo/laravel-trait-encrypt

A Laravel Eloquent Model trait for Encrypting model data

17,775 3
someonefamous/laravel-findby

Extended 'find' functionality for Eloquent (Laravel).

11,659 3

Version History

Version Released PHP License
1.0.2 >=5.4.0 MIT
1.0.1 >=5.4.0 MIT
1.0.0 >=5.4.0 MIT