larapack/attribute-encryption
Allows you to define what attributes in your eloquent model which should be encrypted and decrypted.
1,936
3
| Install | |
|---|---|
composer require larapack/attribute-encryption |
|
| Latest Version: | v1.0.0 |
| License: | MIT |
| Last Updated: | Mar 4, 2016 |
| Links: | GitHub · Packagist |
Maintainer: marktopper
attribute-encryption
Allows you to define what attributes in your eloquent model which should be encrypted and decrypted.
Installing
Install using Composer composer require larapack/attribute-encryption 1.*.
Usage
First add the traits Manipulateable and Encryptable to your Eloquent Model.
<?php
namespace App;
use Larapack/AttributeManipulating/Manipulateable;
use Larapack/AttributeEncryption/Encryptable;
class User
{
use Manipulateable;
use Encryptable;
/**
* @var array List of attribute names which should be encrypted
*/
protected $encrypt = ['password']; // set the attribute names you which to encrypt/decrypt
//...
}
Now whenever you set the attribute password it will now be encrypted and whenever you get the attribute it will be decrypted.
Test:
$user = new App\User;
$user->password = 'secret';
echo $user->getOriginalAttribute('password'); // Here you will see the encrypted password
dump($user); // Here you will see the encrypted password
echo $user->password; // Here you will see the decrypted password
Related Packages
payamjafari/laravel-db-encrypter
Provides database model attribute encryption/decryption
512
1
attribute
database
database encrypter
database encryption
decrypt
decrypted
decryption
eloquent
encrypt
encrypter
encryption
laravel
laravel attribute encrypter
laravel attribute encryption
laravel database encrypter
laravel database encryption
laravel db encrypter
laravel db encryption
laravel model encrypter
laravel model encryption
laravel mongodb attribute encrypter
mongodb
betterapp/laravel-db-encrypter
Provides database model attribute encryption/decryption
663,991
363
attribute
database
database encrypter
database encryption
decrypt
decrypted
decryption
eloquent
encrypt
encrypter
encryption
laravel
laravel attribute encrypter
laravel attribute encryption
laravel database encrypter
laravel database encryption
laravel db encrypter
laravel db encryption
laravel model encrypter
laravel model encryption
soarecostin/file-vault
197,245
191
larapack/attribute-slugging
Allows your Eloquent Model to automatically generate a unique slug for a attribu...
2,023
5