1. Go to this page and download the library: Download richard8768/hashing 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/ */
declare(strict_types=1);
namespace App\Http\Controller;
use Hyperf\HttpServer\Request;
use HyperfExt\Hashing\Hash;
class UpdatePasswordController
{
public function update(Request $request)
{
// ……
$user->fill([
'password' => Hash::make($request->input('new_password'))
])->save();
}
}