src/Domain/DefaultMenu.php
public function group($name, Closure $callback = null)
    {
        if ($this->groups->has($name)) {
            $group = $this->groups->get($name);
        } else {
            $group = $this->container->make('Maatwebsite\Sidebar\Group');
            $group->name($name);
        }

        $this->call($callback, $group);

        $this->addGroup($group);

        return $group;
    }
public function group($name, Closure $callback = null)
    {
        if ($this->groups->has($name)) {
            $group = $this->groups->get($name);
        } else {
            $group = $this->container->make('Maatwebsite\Sidebar\Group');
            $group->name($name);
        }

        $this->call($callback, $group);

        $this->addGroup($group);

        return $group;
    }
public function group ( $ name , Closure $ callback = null ) { if ( $ this -> groups -> has ( $ name ) ) { $ group = $ this -> groups -> get ( $ name ) ; } else { $ group = $ this -> container -> make ( 'Maatwebsite\Sidebar\Group' ) ; $ group -> name ( $ name ) ; } $ this -> call ( $ callback , $ group ) ; $ this -> addGroup ( $ group ) ; return $ group ; }
Init a new group or call an existing group and add it to the menu

@param          $name
@param callable $callback

@return Group
Init a new group or call an existing group and add it to the menu