src/Observers/UriObserver.php
public function updating(Page $model)
    {
        $slugs = $model->getTranslations('slug');
        $parentUris = $this->getParentUris($model);

        foreach ($slugs as $locale => $slug) {
            $parentUri = $parentUris[$locale] ?? '';
            if ($parentUri !== '') {
                $uri = $parentUri;
                if ($slug) {
                    $uri .= '/'.$slug;
                }
            } else {
                $uri = $slug;
            }
            $uri = $this->incrementWhileExists($model, $uri, $locale, $model->id);
            $model->setTranslation('uri', $locale, $uri);
        }
    }
public function updating(Page $model)
    {
        $slugs = $model->getTranslations('slug');
        $parentUris = $this->getParentUris($model);

        foreach ($slugs as $locale => $slug) {
            $parentUri = $parentUris[$locale] ?? '';
            if ($parentUri !== '') {
                $uri = $parentUri;
                if ($slug) {
                    $uri .= '/'.$slug;
                }
            } else {
                $uri = $slug;
            }
            $uri = $this->incrementWhileExists($model, $uri, $locale, $model->id);
            $model->setTranslation('uri', $locale, $uri);
        }
    }
public function updating ( Page $ model ) { $ slugs = $ model -> getTranslations ( 'slug' ) ; $ parentUris = $ this -> getParentUris ( $ model ) ; foreach ( $ slugs as $ locale => $ slug ) { $ parentUri = $ parentUris [ $ locale ] ?? '' ; if ( $ parentUri !== '' ) { $ uri = $ parentUri ; if ( $ slug ) { $ uri .= '/' . $ slug ; } } else { $ uri = $ slug ; } $ uri = $ this -> incrementWhileExists ( $ model , $ uri , $ locale , $ model -> id ) ; $ model -> setTranslation ( 'uri' , $ locale , $ uri ) ; } }
On update, change uri.

@param Page $model

@return null
On update change uri .