Package Data | |
---|---|
Maintainer Username: | betterapp |
Maintainer Contact: | biuro@betterapp.net (Daniel Czestki) |
Package Create Date: | 2020-01-12 |
Package Last Update: | 2023-03-02 |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-15 03:02:40 |
Package Statistics | |
---|---|
Total Downloads: | 451,625 |
Monthly Downloads: | 10,285 |
Daily Downloads: | 436 |
Total Stars: | 362 |
Total Watchers: | 10 |
Total Forks: | 46 |
Total Open Issues: | 11 |
This package was created to encrypt and decrypt values of Eloquent model attributes.
Encrypted values are stored as plain text so in most cases takes up more spaces then unencrypted one.
Recommendation is to alter table column to TEXT
type.
If you want use VARCHAR
or CHAR
column type still you need to check if encrypted value fit.
Do not worry if you have current data in your database not encrypted and added column to $encryptable
- they will return as is.
On save values will be encrypted and everything will work fine.
Via Composer command line:
$ composer require betterapp/laravel-db-encrypter
betterapp\LaravelDbEncrypter\Traits\EncryptableDbAttribute
trait in any Eloquent model that you wish to use encryptionprotected $encryptable
array containing a list of the encrypted attributes.For example:
use betterapp\LaravelDbEncrypter\Traits\EncryptableDbAttribute;
class Client extends Eloquent {
use EncryptableDbAttribute;
/** @var array The attributes that should be encrypted/decrypted */
protected $encryptable = [
'id_number',
'email',
];
}
The MIT License (MIT). Please see License File for more information.