Password with hash and salt return "class hash not found" (solved)

Hi guys;

I need do to this:

    $salt = bin2hex(hash::salt(32));
    $hash = hash::make($pass, $salt); 

But i received this:

Type: Error
Message: Class ‘App\DAO\MySQL\innhouse\hash’ not found
File: C:\xampp\htdocs\InnHouseAPI\App\DAO\MySQL\innhouse\UsuariosDAO.php
Line: 60

How can i do a “use” or “require once” to acess this class hash in Slim 3 please ?

In my other sistems without Slim i have no problem do to this.


The error message you’re seeing indicates that the hash class cannot be found in the current namespace.

Ensure that your PHP file has the correct namespace declaration at the top.

Example: use Vendor\Package\hash;

Class names are usually writing in the UpperCamelCase (PascalCase or StudlyCaps) notation. Make sure the filename matches the class name (case sensitive) and has a .php extension.

“Hash” class filename: “Hash.php”
Usage example: use Vendor\Package\Hash;

Lastly, as a side note, it’s a good practice to avoid using reserved words as class names. hash might be a bit misleading since PHP has a native hash extension. Consider renaming your class to something more descriptive to avoid potential confusion.

Thanks my friend; i found a class Hash.php in my old app; this is the solution to my problem.