Your IP : 216.73.216.93


Current Path : /home/users/unlimited/www/whatsapp-crm/app/Rules/
Upload File :
Current File : /home/users/unlimited/www/whatsapp-crm/app/Rules/ConfirmOldPassword.php

<?php 

namespace App\Rules;

use Illuminate\Contracts\Validation\Rule;
use Illuminate\Support\Facades\Hash;

class ConfirmOldPassword implements Rule
{
    /**
     * Determine if the validation rule passes.
     *
     * @param  string  $attribute
     * @param  mixed  $value
     * @return bool
     */
    public function passes($attribute, $value)
    {
        // Check if the old password matches the user's actual old password
        return Hash::check($value, auth()->user()->password);
    }

    /**
     * Get the validation error message.
     *
     * @return string
     */
    public function message()
    {
        return __('The old password does not match.');
    }
}