hash_password()

public function hash_password(string $password): string

Description

Hashes a plain-text password using bcrypt with the configured cost factor from config/login.php. Uses PHP's built-in password_hash() function with the PASSWORD_DEFAULT algorithm.

Parameters

ParameterTypeDescriptionDefaultRequired
passwordstringThe plain-text password to hash.N/AYes

Return Value

TypeDescription
stringThe bcrypt-hashed password string.