Files
DBXE/vendor/rakit/validation/src/Rules/Different.php
T
2021-05-21 08:49:41 +02:00

25 lines
477 B
PHP

<?php
namespace Rakit\Validation\Rules;
use Rakit\Validation\Rule;
class Different extends Rule
{
protected $message = "The :attribute must be different with :field";
protected $fillable_params = ['field'];
public function check($value)
{
$this->requireParameters($this->fillable_params);
$field = $this->parameter('field');
$another_value = $this->validation->getValue($field);
return $value != $another_value;
}
}