PHP code example of lukeelten / cakephp-password-hasher

1. Go to this page and download the library: Download lukeelten/cakephp-password-hasher library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lukeelten / cakephp-password-hasher example snippets


$this->loadComponent('Auth', [
    'authenticate' => [
        'Form' => [
            'passwordHasher' => Argon2PasswordHasher::class
            // 'passwordHasher' => SecurePasswordHasherChain::class
        ]
    ]
];

class User extends Entity
{
    protected function _setPassword($value) {
        $hasher = new Argon2PasswordHasher();
        return $hasher->hash($value);
    }
}