src/Gzero/Cms/Menu/Register.php
public function getMenu()
    {
        $this->links->each(
            function ($link) {
                if (!$link->children->isEmpty()) {
                    $link->children = $link->children->sortBy('weight')->values();
                }
            }
        );
        return $this->links->sortBy('weight')->values();
    }
public function getMenu()
    {
        $this->links->each(
            function ($link) {
                if (!$link->children->isEmpty()) {
                    $link->children = $link->children->sortBy('weight')->values();
                }
            }
        );
        return $this->links->sortBy('weight')->values();
    }
public function getMenu ( ) { $ this -> links -> each ( function ( $ link ) { if ( ! $ link -> children -> isEmpty ( ) ) { $ link -> children = $ link -> children -> sortBy ( 'weight' ) -> values ( ) ; } } ) ; return $ this -> links -> sortBy ( 'weight' ) -> values ( ) ; }
It returns whole menu as tree

@return Collection
It returns whole menu as tree