I am implementing a "Change Password" feature in my Laravel application. I already have the user's current password stored in the object $pass. I need to validate this $pass against the form input current_password to ensure the user entered their correct current password before allowing them to set a new password.
Here’s the validation rule I tried:
$rules = array('password_current' => "required|same:$pass");
Unfortunately, this doesn't work, and I get an error. How can I validate the user's input (current_password) against the stored password ($pass) using Laravel's validation system?