Encryptable
trait Winter\Storm\Database\Traits\Encryptable
Properties
protected $encrypterInstance : Illuminate\Contracts\Encryption\Encrypter
Encrypter instance.
protected
$originalEncryptableValues
:
array
= []
List of original attribute values before they were encrypted.
Methods
public static bootEncryptable () : void
Boot the encryptable trait for a model.
Returns
void
public getEncryptableAttributes () : array
Returns a collection of fields that will be encrypted.
Returns
array
public getEncryptableValue (string $key) : string
Decrypts an attribute value
Parameters
Property | Type | Description |
---|---|---|
$key | string |
string
Attribute |
Returns
string
Decrypted value
public getEncrypter () : Illuminate\Contracts\Encryption\Encrypter
Provides the encrypter instance.
Returns
Illuminate\Contracts\Encryption\Encrypter
public getOriginalEncryptableValue ($attribute) : mixed
Returns the original values of any encrypted attributes.
Parameters
Property | Type | Description |
---|---|---|
$attribute | mixed |
mixed
|
Returns
mixed
public getOriginalEncryptableValues () : array
Returns the original values of any encrypted attributes.
Returns
array
public makeEncryptableValue (string $key, string $value) : string
Encrypts an attribute value and saves it in the original locker.
Parameters
Property | Type | Description |
---|---|---|
$key | string |
string
Attribute |
$value | string |
string
Value to encrypt |
Returns
string
Encrypted value
public setEncrypter (Illuminate\Contracts\Encryption\Encrypter $encrypter) : void
Sets the encrypter instance.
Parameters
Property | Type | Description |
---|---|---|
$encrypter | Illuminate\Contracts\Encryption\Encrypter |
Illuminate\Contracts\Encryption\Encrypter
|
Returns
void
← Previous page
Winter\Storm\Database\Traits\DeferredBinding
Next page →
Winter\Storm\Database\Traits\HasSortableRelations
Copyright © 2024 Winter CMS