I'm trying to use Hash in my global functions file.
I keep getting this error.
Class 'App\Http\Controllers\Hash' not found
where my file below is located at:
/app/Helpers/functions.php
<?php
use App\Http\Controllers\Hash;
// If old password matches password
function checkOldPassword($oldPassword, $user) {
if (Hash::check($oldPassword, $user->password)) {
dd('a');
}
else {
return back()->withErrors([
'message' => 'Your old password is incorrect.'
]);
}
}