classes/Collections/Elements.php
public function onlyPages($pages)
    {
        $this->items = array_filter($this->items, function ($element) use ($pages) {
            return in_array(Str::slug($element['page_label']), $pages);
        });

        return $this;
    }
public function onlyPages($pages)
    {
        $this->items = array_filter($this->items, function ($element) use ($pages) {
            return in_array(Str::slug($element['page_label']), $pages);
        });

        return $this;
    }
public function onlyPages ( $ pages ) { $ this -> items = array_filter ( $ this -> items , function ( $ element ) use ( $ pages ) { return in_array ( Str :: slug ( $ element [ 'page_label' ] ) , $ pages ) ; } ) ; return $ this ; }
Filter the elements to only those allowed in the provided pages

@param  array $pages
@return $this
Filter the elements to only those allowed in the provided pages