I'm using Lumen to develop my API website, I came across this part where I hash password and check hash but it always returns false
below is my attempt.
$hashed = $request->input('hash'); // e.g. $2y$10$EBQKLl5cdbOLzP0luWUlp.hQYJLYGnDeOymodXSAbWj.Posf.yv1m
$res = Hash::check(trim($request->input('password')), trim($hashed));
return response()->json([ 'hash' => $hashed, 'password' => $request->input('password')), 'hash_result' => $res ]);
I use trim so to make sure there are not whitespaces and I can verify variables (hash, password) exist so what seem's wrong?
using postman
Any help, ideas is greatly appreciated. Thank you.