All notable changes to eloquentencryption
will be documented in this file
- As of Laravel 8.14 you can specify the built in Eloquent Encryption casting setting a model's encryptUsing in your app service provider. This allows for automatic separation of your APP_KEY, when using a different
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',
];
}
- EloquentEncryption now uses
Illuminate\Contracts\Encryption\Encrypter
contract. - BC If relying on 1.x use
encryptString()
ordecryptString()
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.
- Add
EncryptedBoolean
cast by @valorin #3
- Add optional support to define
RsaKeyHandler
to store, retrieved generated RSA keys.
- bug fix
- Add additional Cast classes.
EncryptedInteger
EncryptedFloat
EncryptedCollection
- Update README.md
- Refactor how blueprint helper's are included.
- initial release
- Adds
encrypted
field type to migrations blueprints. - Adds
encrypt:generate
command to create RSA keys. - Adds
Encrypted
cast to encode/decode the fields which have been set on a model.