This is great, as well as how it should work. Laravel uses Bcrypt for Hashing and therefore generates random salt during the hash process. Salt will be part of the hash, so you get two different results.
The self-learning algorithm automatically considers salt. This method makes using rainbow tables virtually impossible.
This is not a mistake, this is extra security without effort.
Given that your example with both of your hashes will return true:
<?php $hash1 = Hash::make('1234'); // A hash is generated $hash2 = Hash::make('1234'); // Another hash is generated that differs from the first one var_dump(Hash::check('1234', $hash1) && Hash::check('1234', $hash2));
Despite the fact that $hash1 and $hash2 contain different hashes, it is very important for them that this base line be evaluated as true.
The generated hash is 60 characters long. Therefore, make sure that the column in which the hash is stored has a minimum size of 60 characters
source share