Compare Plain String to Hash
Sometimes we need to check if the user typed the correct password, even if the user is authenticated. For example, before changing its settings, we force the user to type the password again to increase the security of our application.
Laravel provides an Illuminate\Support\Facades\Hash facade, which helps us to word with hashing and encryption. If you are interested in its documentation you can find it here: https://laravel.com/docs/5.7/hashing.
So, to compare plain string with its hashed version, the facade offers the check method to perform this action.
use Illuminate\Support\Facades\Hash; $user = App\User::first(); // Compare the string to the hash Hash::check('password', $user->password);