Support the ongoing development of Laravel.io →
Authentication Security

I am implementing a user change password feature. However i don't want user to be able to use old past word for the new one. I store the old hashed password in a past_password table.

now i need to compare the newly enter password from user to his/her past password

i understand Hash::make generates a different hash even if the input is the same, i know you can use Hash::check to compare the old and new password

however is this the only way? this would mean i have to select ALL past passwords and call Hash:check one at a time to make sure there is no repeat.

With old hashing algo i could of just do a database select to find out if the new match the past hashed password

anyone have any suggestions?

Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.