richardstyles/eloquentencryption
encrypted field type to migrations blueprints.encrypt:generate command to create RSA keys.Encrypted cast to encode/decode the fields which have been set on a model.Illuminate\Contracts\Encryption\Encrypter class/instance.EncryptedCast::encryptUsing(new \RichardStyles\EloquentEncryption\EloquentEncryption);
Then simply define your casts in your model as you normally would.
class EncryptedCast extends Model
{
public $casts = [
'secret' => 'encrypted',
'secret_array' => 'encrypted:array',
'secret_json' => 'encrypted:json',
'secret_object' => 'encrypted:object',
'secret_collection' => 'encrypted:collection',
];
}
Illuminate\Contracts\Encryption\Encrypter contract.encryptString() or decryptString() functions if you are using this encryption elsewhere in your application. As the default encrypt/decrypt function now serialize values automatically, this may cause unexpected errors during decrypting.RsaKeyHandler to store, retrieved generated RSA keys.EncryptedIntegerEncryptedFloatEncryptedCollectionHow can I help you explore Laravel packages today?