src/Observers/UriObserver.php
private function incrementWhileExists(Page $model, $uri, $locale, $id = null)
    {
        if (!$uri) {
            return '';
        }

        $originalUri = $uri;

        $i = 0;
        // Check if uri is unique
        while ($this->uriExists($model, $uri, $locale, $id)) {
            $i++;
            // increment uri if it exists
            $uri = $originalUri.'-'.$i;
        }

        return $uri;
    }
private function incrementWhileExists(Page $model, $uri, $locale, $id = null)
    {
        if (!$uri) {
            return '';
        }

        $originalUri = $uri;

        $i = 0;
        // Check if uri is unique
        while ($this->uriExists($model, $uri, $locale, $id)) {
            $i++;
            // increment uri if it exists
            $uri = $originalUri.'-'.$i;
        }

        return $uri;
    }
private function incrementWhileExists ( Page $ model , $ uri , $ locale , $ id = null ) { if ( ! $ uri ) { return '' ; } $ originalUri = $ uri ; $ i = 0 ; // Check if uri is unique while ( $ this -> uriExists ( $ model , $ uri , $ locale , $ id ) ) { $ i ++ ; // increment uri if it exists $ uri = $ originalUri . '-' . $ i ; } return $ uri ; }
Add '-x' on uri if it exists in page_translations table.

@param Page   $model
@param string $uri
@param int    $id

@return string
Add - x on uri if it exists in page_translations table .