Encryptable database trait

Protected properties

protected array $originalEncryptableValues

originalEncryptableValues is the original attribute values before they were encrypted

Public methods

public static void bootEncryptable()

bootEncryptable boots the encryptable trait for a model

public array getEncryptableAttributes()

getEncryptableAttributes returns a collection of fields that will be encrypted.

public string getEncryptableValue(string $key)

getEncryptableValue decrypts an attribute value

  • string $key - Attribute

public mixed getOriginalEncryptableValue($attribute)

getOriginalEncryptableValue returns the original values of any encrypted attributes.

  • $attribute

public array getOriginalEncryptableValues()

getOriginalEncryptableValues returns the original values of any encrypted attributes

public string makeEncryptableValue(string $key, string $value)

makeEncryptableValue encrypts an attribute value and saves it in the original locker

  • string $key - Attribute
  • string $value - Value to encrypt