public function toExtendedArray()
    {
        $items  = [];
        foreach ($this->items as $path => $slug) {
            $page = $this->pages->get($path);

            if ($page !== null) {
                $items[$page->route()] = $page->toArray();
            }
        }
        return $items;
    }
public function toExtendedArray()
    {
        $items  = [];
        foreach ($this->items as $path => $slug) {
            $page = $this->pages->get($path);

            if ($page !== null) {
                $items[$page->route()] = $page->toArray();
            }
        }
        return $items;
    }
public function toExtendedArray ( ) { $ items = [ ] ; foreach ( $ this -> items as $ path => $ slug ) { $ page = $ this -> pages -> get ( $ path ) ; if ( $ page !== null ) { $ items [ $ page -> route ( ) ] = $ page -> toArray ( ) ; } } return $ items ; }
Get the extended version of this Collection with each page keyed by route

@return array
@throws \Exception
Get the extended version of this Collection with each page keyed by route