Hashable
Table of Contents
- $originalHashableValues : array<string|int, mixed>
- addHashable() : $this
- Adds an attribute to the hashable attributes list
- addHashableAttribute() : mixed
- bootHashable() : void
- Boot the hashable trait for a model.
- checkHashValue() : bool
- Checks if the supplied plain value matches the stored hash value.
- getHashableAttributes() : array<string|int, mixed>
- Returns a collection of fields that will be hashed.
- getOriginalHashValue() : mixed
- Returns the original values of any hashed attributes.
- getOriginalHashValues() : array<string|int, mixed>
- Returns the original values of any hashed attributes.
- makeHashValue() : string
- Hashes an attribute value and saves it in the original locker.
Properties
$originalHashableValues
protected
array<string|int, mixed>
$originalHashableValues
= []
List of original attribute values before they were hashed.
Methods
addHashable()
Adds an attribute to the hashable attributes list
public
addHashable([array<string|int, mixed>|string|null $attributes = null ]) : $this
Parameters
- $attributes : array<string|int, mixed>|string|null = null
Return values
$this —addHashableAttribute()
public
addHashableAttribute(mixed $attribute) : mixed
Parameters
- $attribute : mixed
Tags
Return values
mixed —bootHashable()
Boot the hashable trait for a model.
public
static bootHashable() : void
Return values
void —checkHashValue()
Checks if the supplied plain value matches the stored hash value.
public
checkHashValue(string $key, string $value) : bool
Parameters
- $key : string
-
Attribute to check
- $value : string
-
Value to check
Return values
bool —getHashableAttributes()
Returns a collection of fields that will be hashed.
public
getHashableAttributes() : array<string|int, mixed>
Return values
array<string|int, mixed> —getOriginalHashValue()
Returns the original values of any hashed attributes.
public
getOriginalHashValue(mixed $attribute) : mixed
Parameters
- $attribute : mixed
Return values
mixed —getOriginalHashValues()
Returns the original values of any hashed attributes.
public
getOriginalHashValues() : array<string|int, mixed>
Return values
array<string|int, mixed> —makeHashValue()
Hashes an attribute value and saves it in the original locker.
public
makeHashValue(string $key, string $value) : string
Parameters
- $key : string
-
Attribute
- $value : string
-
Value to hash
Return values
string —Hashed value