ignore = $id; $this->idColumn = $idColumn; return $this; } /** * Convert the rule to a validation string. * * @return string */ public function __toString() { return rtrim(sprintf('unique:%s,%s,%s,%s,%s', $this->table, $this->column, $this->ignore ? '"'.$this->ignore.'"' : 'NULL', $this->idColumn, $this->formatWheres() ), ','); } }