Hashable

 trait Winter\Storm\Database\Traits\Hashable

Properties

protected $originalHashableValues : array

List of original attribute values before they were hashed.

Methods

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

Adds an attribute to the hashable attributes list

Parameters
Property Description
$attributes
array | string | null
Returns
$this

public addHashableAttribute ($attribute)

Parameters
Property Description
$attribute
mixed
Returns
mixed

public static bootHashable () : void

Boot the hashable trait for a model.

Returns
void

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

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

Parameters
Property Description
$key
string

Attribute to check

$value
string

Value to check

Returns
bool

public getHashableAttributes () : array

Returns a collection of fields that will be hashed.

Returns
array

public getOriginalHashValue ($attribute) : mixed

Returns the original values of any hashed attributes.

Parameters
Property Description
$attribute
mixed
Returns
mixed

public getOriginalHashValues () : array

Returns the original values of any hashed attributes.

Returns
array

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

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

Parameters
Property Description
$key
string

Attribute

$value
string

Value to hash

Returns
string

Hashed value

Used by

Class Description
User

Administrator user model

User

User model

Copyright © 2024 Winter CMS