public function modular()
    {
        $modular = [];

        foreach ($this->items as $path => $slug) {
            $page = $this->pages->get($path);
            if ($page !== null && $page->modular()) {
                $modular[$path] = $slug;
            }
        }
        $this->items = $modular;

        return $this;
    }
public function modular()
    {
        $modular = [];

        foreach ($this->items as $path => $slug) {
            $page = $this->pages->get($path);
            if ($page !== null && $page->modular()) {
                $modular[$path] = $slug;
            }
        }
        $this->items = $modular;

        return $this;
    }
public function modular ( ) { $ modular = [ ] ; foreach ( $ this -> items as $ path => $ slug ) { $ page = $ this -> pages -> get ( $ path ) ; if ( $ page !== null && $ page -> modular ( ) ) { $ modular [ $ path ] = $ slug ; } } $ this -> items = $ modular ; return $ this ; }
Creates new collection with only modular pages

@return Collection The collection with only modular pages
Creates new collection with only modular pages