app/Services/TitleValidator/PageTitleValidator.php
/**
     * Check that the given page title is unique for updating.
     * 
     *@param int $id
     * @return boolean
     */
Check that the given page title is unique for updating.

@param int $id
@return boolean
Check that the given page title is unique for updating . @param int $id @return boolean
public function isTitleUniqueForUpdating(int $id)
    {
        $sameTitle = Page::Where([
                                    ['id', '<>', $id],
                                    ['title', $this->validData['title']]
                                ])->get();
        if($sameTitle->count() > 0)
        {
            return false;
        }
        return true;
    }
public function isTitleUniqueForUpdating ( int $ id ) { $ sameTitle = Page :: Where ( [ [ 'id' , '<>' , $ id ] , [ 'title' , $ this -> validData [ 'title' ] ] ] ) -> get ( ) ; if ( $ sameTitle -> count ( ) > 0 ) { return false ; } return true ; }
Check that the given page title is unique for updating.
Check that the given page title is unique for updating .