Hello I keep getting this error when trying to verify the hashed token with the unhashed token . "message": "Undefined property: IlluminateDatabaseQueryBuilder::$token", Can someone please help me since ive been stuck on this error for nearly 2 hours now.
public function verifyResetPageAccess(Request $request){
$email = $request->email;
$token = $request->token;
// $exists = password_reset::where('email', $email)->first();
$exists = DB::table('password_resets')->where('email',$email);
$dbToken = $exists->select('token');
if($exists === null){
return response(['message'=>'unauthorized'],401);
}else{
if(Hash::check($token, $dbToken->token)) {
return response(['message'=>'authorized']);
}else{
return response(['message'=>'error occured'],401);
}
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…