src/Observers/UriObserver.php
private function uriExists(Page $model, $uri, $locale, $id)
    {
        $query = $model->where('uri->'.$locale, $uri);
        if ($id) {
            $query->where('id', '!=', $id);
        }

        if ($query->first()) {
            return true;
        }

        return false;
    }
private function uriExists(Page $model, $uri, $locale, $id)
    {
        $query = $model->where('uri->'.$locale, $uri);
        if ($id) {
            $query->where('id', '!=', $id);
        }

        if ($query->first()) {
            return true;
        }

        return false;
    }
private function uriExists ( Page $ model , $ uri , $ locale , $ id ) { $ query = $ model -> where ( 'uri->' . $ locale , $ uri ) ; if ( $ id ) { $ query -> where ( 'id' , '!=' , $ id ) ; } if ( $ query -> first ( ) ) { return true ; } return false ; }
Check if the uri exists.

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

@return bool
Check if the uri exists .