@friedrich Then don't use this rule. Just compare user's password with plain password directly :
if (Hash::check('plain-password', $hashedPasswordFromDB)) {
// The passwords matches
}
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi Guys, I want to know how can I edit the password of every user using matching a old password to confirm the validation thanks in advance i have rule that checks the old password of the user but only the current signed in system
<?php
namespace App\Rules;
use Illuminate\Contracts\Validation\Rule;
use Illuminate\Support\Facades\Hash;
class MatchOldPassword implements Rule
{
/**
* Determine if the validation rule passes.
*
* @param string $attribute
* @param mixed $value
* @return bool
*/
public function passes($attribute, $value)
{
return Hash::check($value, auth()->user()->password);
}
/**
* Get the validation error message.
*
* @return string
*/
public function message()
{
return 'The attribute is match with old password.';
}
}
I want to change the auth()->user() into $request->id->password for example please help me
Please or to participate in this conversation.