• File: SamePassword.php
  • Full Path: /var/www/imalipartnersapi/app/Rules/SamePassword.php
  • Date Modified: 02/07/2023 8:01 PM
  • File size: 474 bytes
  • MIME-type: text/x-php
  • Charset: utf-8
<?php


namespace App\Rules;


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

class SamePassword implements Rule
{

    /**
     * @inheritDoc
     */
    public function passes($attribute, $value)
    {
        return Hash::check($value,auth()->user()->password);
    }

    /**
     * @inheritDoc
     */
    public function message()
    {
        return 'A Nova Senha não Deve Ser Igual a Anterior';
    }
}