public function route($route, $title, $parameters = array(), $order = null, $attributes = array())
    {
        if (func_num_args() == 4) {
            $arguments = func_get_args();

            return $this->add([
                'route' => [array_get($arguments, 0), array_get($arguments, 2)],
                'title' => array_get($arguments, 1),
                'attributes' => array_get($arguments, 3)
            ]);
        }

        $route = array($route, $parameters);

        $item = MenuItem::make(
            compact('route', 'title', 'parameters', 'attributes', 'order')
        );

        $this->items[] = $item;

        return $item;
    }
public function route($route, $title, $parameters = array(), $order = null, $attributes = array())
    {
        if (func_num_args() == 4) {
            $arguments = func_get_args();

            return $this->add([
                'route' => [array_get($arguments, 0), array_get($arguments, 2)],
                'title' => array_get($arguments, 1),
                'attributes' => array_get($arguments, 3)
            ]);
        }

        $route = array($route, $parameters);

        $item = MenuItem::make(
            compact('route', 'title', 'parameters', 'attributes', 'order')
        );

        $this->items[] = $item;

        return $item;
    }
public function route ( $ route , $ title , $ parameters = array ( ) , $ order = null , $ attributes = array ( ) ) { if ( func_num_args ( ) == 4 ) { $ arguments = func_get_args ( ) ; return $ this -> add ( [ 'route' => [ array_get ( $ arguments , 0 ) , array_get ( $ arguments , 2 ) ] , 'title' => array_get ( $ arguments , 1 ) , 'attributes' => array_get ( $ arguments , 3 ) ] ) ; } $ route = array ( $ route , $ parameters ) ; $ item = MenuItem :: make ( compact ( 'route' , 'title' , 'parameters' , 'attributes' , 'order' ) ) ; $ this -> items [ ] = $ item ; return $ item ; }
Register new menu item using registered route.

@param $route
@param $title
@param array $parameters
@param array $attributes

@return static
Register new menu item using registered route .