private function findActivePageTiers()
    {
        // if selected page has a parent
        // find all pages with same parent id
        // if more than 1 - valid
        // if less than 1 - return 'about us'

        $name = 'About Us';
        $items = collect();
        if ($this->page->parent_id > 0) {
            $rows = Page::where('parent_id', $this->page->parent_id)
                ->orderBy('header_order')
                ->get();

            if ($items->count() > 1) {
                $items = $rows;
                $name = $this->page->parent->name;
            }
        }

        return (object) [
            'name'  => $name,
            'items' => $items,
        ];
    }
private function findActivePageTiers()
    {
        // if selected page has a parent
        // find all pages with same parent id
        // if more than 1 - valid
        // if less than 1 - return 'about us'

        $name = 'About Us';
        $items = collect();
        if ($this->page->parent_id > 0) {
            $rows = Page::where('parent_id', $this->page->parent_id)
                ->orderBy('header_order')
                ->get();

            if ($items->count() > 1) {
                $items = $rows;
                $name = $this->page->parent->name;
            }
        }

        return (object) [
            'name'  => $name,
            'items' => $items,
        ];
    }
private function findActivePageTiers ( ) { // if selected page has a parent // find all pages with same parent id // if more than 1 - valid // if less than 1 - return 'about us' $ name = 'About Us' ; $ items = collect ( ) ; if ( $ this -> page -> parent_id > 0 ) { $ rows = Page :: where ( 'parent_id' , $ this -> page -> parent_id ) -> orderBy ( 'header_order' ) -> get ( ) ; if ( $ items -> count ( ) > 1 ) { $ items = $ rows ; $ name = $ this -> page -> parent -> name ; } } return ( object ) [ 'name' => $ name , 'items' => $ items , ] ; }
Get the active page tiers and the parent
@return object
Get the active page tiers and the parent