October\Rain\Database\Traits\Hashable

Source: ~/vendor/october/rain/src/Database/Traits/Hashable.php

Protected properties

protected array $originalHashableValues

List of original attribute values before they were hashed.

Public methods

public $this addHashable(array|string|null $attributes=NULL)

Adds an attribute to the hashable attributes list

Parameters
  • array|string|null $attributes

public void addHashableAttribute($attribute)
Parameters
  • $attribute

public static void bootHashable()

Boot the hashable trait for a model.

public bool checkHashValue(string $key, string $value)

Checks if the supplied plain value matches the stored hash value.

Parameters
  • string $key - Attribute to check
  • string $value - Value to check

public array getHashableAttributes()

Returns a collection of fields that will be hashed.

public mixed getOriginalHashValue($attribute)

Returns the original values of any hashed attributes.

Parameters
  • $attribute

public array getOriginalHashValues()

Returns the original values of any hashed attributes.

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

Hashes an attribute value and saves it in the original locker.

Parameters
  • string $key - Attribute
  • string $value - Value to hash