app/Services/TitleValidator/SectionTitleValidator.php
/**
     * Check that the given section title is unique on current page for storing.
     * 
     * @return boolean
     */
Check that the given section title is unique on current page for storing.

@return boolean
Check that the given section title is unique on current page for storing . @return boolean
public function isTitleUniqueForStoring()
    {
        $titleOnPage = Section::where([
                                        ['title', $this->validData['title']],
                                        ['page_id', $this->validData['page_id']]
                                ])->get();
        if($titleOnPage->count() > 0 )
        {
            return false;
        }
        return true;
    }
public function isTitleUniqueForStoring ( ) { $ titleOnPage = Section :: where ( [ [ 'title' , $ this -> validData [ 'title' ] ] , [ 'page_id' , $ this -> validData [ 'page_id' ] ] ] ) -> get ( ) ; if ( $ titleOnPage -> count ( ) > 0 ) { return false ; } return true ; }
Check that the given section title is unique on current page for storing.
Check that the given section title is unique on current page for storing .