src/Menu/MenuConfigInterpreter.php
protected function filterEmptyGroups(LayoutData $layout)
    {
        $presences = $layout->layout;

        $remove = [];

        foreach ($presences as $key => $presence) {

            if ( ! $this->filterNestedEmptyGroups($presence)) {
                $remove[] = $key;
            }
        }
        array_forget($presences, $remove);

        $layout->layout = $presences;
    }
protected function filterEmptyGroups(LayoutData $layout)
    {
        $presences = $layout->layout;

        $remove = [];

        foreach ($presences as $key => $presence) {

            if ( ! $this->filterNestedEmptyGroups($presence)) {
                $remove[] = $key;
            }
        }
        array_forget($presences, $remove);

        $layout->layout = $presences;
    }
protected function filterEmptyGroups ( LayoutData $ layout ) { $ presences = $ layout -> layout ; $ remove = [ ] ; foreach ( $ presences as $ key => $ presence ) { if ( ! $ this -> filterNestedEmptyGroups ( $ presence ) ) { $ remove [ ] = $ key ; } } array_forget ( $ presences , $ remove ) ; $ layout -> layout = $ presences ; }
Filters any groups from the layout that are empty.

This is merely a safeguard for module presence definitions that
contain empty groups to start with.

@param LayoutData $layout
Filters any groups from the layout that are empty .