src/UniqueTranslationValidator.php
protected function isUnique($value, $name, $locale, $parameters)
    {
        list ($connection, $table) = $this->getConnectionAndTable($parameters);

        $column = $this->getParameter($parameters, 1) ?? $name;
        $ignoreValue = $this->getParameter($parameters, 2);
        $ignoreColumn = $this->getParameter($parameters, 3);

        $query = $this->findTranslation($connection, $table, $column, $locale, $value);
        $query = $this->ignore($query, $ignoreColumn, $ignoreValue);
        $query = $this->addConditions($query, $this->getUniqueExtra($parameters));

        $isUnique = $query->count() === 0;

        return $isUnique;
    }
protected function isUnique($value, $name, $locale, $parameters)
    {
        list ($connection, $table) = $this->getConnectionAndTable($parameters);

        $column = $this->getParameter($parameters, 1) ?? $name;
        $ignoreValue = $this->getParameter($parameters, 2);
        $ignoreColumn = $this->getParameter($parameters, 3);

        $query = $this->findTranslation($connection, $table, $column, $locale, $value);
        $query = $this->ignore($query, $ignoreColumn, $ignoreValue);
        $query = $this->addConditions($query, $this->getUniqueExtra($parameters));

        $isUnique = $query->count() === 0;

        return $isUnique;
    }
protected function isUnique ( $ value , $ name , $ locale , $ parameters ) { list ( $ connection , $ table ) = $ this -> getConnectionAndTable ( $ parameters ) ; $ column = $ this -> getParameter ( $ parameters , 1 ) ?? $ name ; $ ignoreValue = $ this -> getParameter ( $ parameters , 2 ) ; $ ignoreColumn = $ this -> getParameter ( $ parameters , 3 ) ; $ query = $ this -> findTranslation ( $ connection , $ table , $ column , $ locale , $ value ) ; $ query = $ this -> ignore ( $ query , $ ignoreColumn , $ ignoreValue ) ; $ query = $ this -> addConditions ( $ query , $ this -> getUniqueExtra ( $ parameters ) ) ; $ isUnique = $ query -> count ( ) === 0 ; return $ isUnique ; }
Check if a translation is unique.

@param mixed $value
@param string $name
@param string $locale
@param array $parameters

@return bool
Check if a translation is unique .