/** * @param string $attribute * @param mixed $value * @param array $parameters * @return bool */ protected function validateUnique($attribute, $value, $parameters) { if (isset($this->customAttributes['id'])) { $id = $this->customAttributes['id']; if ($id !== null) { $parameters[] = $id; } } return parent::validateUnique($attribute, $value, $parameters); }