Prevent old password as new password

I need help to tp prevent user entering the same old password as new password
Solution
or

TextInput::make('password')->rules([
    fn (): Closure => function (string $attribute, $value, Closure $fail) {
        if (Hash::check($value, $this->user->password)) {
            $fail('The new password must be different from your current password.');
        }
    },
])
Was this page helpful?